Hi, I've just started using the Python C API for version 2.7.1, and I've
got a question!
How do you define a new type which inherits from multiple types? I've
been browsing the source code for Python 2.7.1 but I'm having a tough
time finding examples. I see that MySQLdb defines low-level class
I don't really know the answer, but more a question/note (below):
> Hi I am using paramiko 1.7.6 "fanny" on microsoft windows xp v2002 service
> pack3 with python 2.4.2
>
> I have the follwing script:
> import paramiko
>
> hostname='blah'
> port=22
> username='blah'
> password='blah'
> fullpat
Hi I am using paramiko 1.7.6 "fanny" on microsoft windows xp v2002 service
pack3 with python 2.4.2
I have the follwing script:
*import paramiko
hostname='blah'
port=22
username='blah'
password='blah'
fullpath='root\\path\\file.xls'
remotepath='/inbox/file.xls'
self.client= paramiko.SSHClient
On 12/23/2010 10:13 AM, Alan Gauld wrote:
"Rasjid Wilcox" wrote
I've been playing with dynamically generated classes. In particular:
class ClassMaker(object):
def __init__(maker_self, name):
maker_self.name = name
#
class Foo(object):
def __init__(self):
On 23 December 2010 20:13, Alan Gauld wrote:
> I think it will do what you want but I wouldn't bother putting the class
> definitions inside the init - unless there is a good reason. At the very
> least I would create two factory methods which are called by init.
> That would allow you to reset th
Thanks for the link.
I use Adapter already for java to align to different interface.
I was curious about the facade implementation.
Regards
Karim
On 12/23/2010 01:25 PM, Alan Gauld wrote:
"Karim" wrote
You mentioned the facade pattern. Could you please provide a basic
simple implementatio
Modulok wrote:
Does anyone know of an efficient way of doing a weighted random
choice? (I don't even know what algorithms like this would be called.)
If you google for "python weighted random choice" you will find a number
of hits.
Preferably, something that doesn't grow exponentially with
"Karim" wrote
You mentioned the facade pattern. Could you please provide a basic
simple implementation of this pattern in python?
Not without spending more time than I have available.
But you can read about it on wikipedia, including Java example code.
However I think I actually should ha
Josep M. Fontana wrote:
Sorry! Sorry! Sorry! I just found out this question had already been
answered by Steven D'Aprano in another thread! The trick was to add
'\w' besides [a-zA-Z].
Hah ha! I didn't see this before I answered... I thought the question
sounded familiar :)
--
Steven
Hi Steven,
On Thu, Dec 23, 2010 at 11:51 AM, Steven D'Aprano wrote:
> Note also that \w means alphanumeric, not just alpha, so it will also match
> digits.
I'm sorry you didn't get to read my next message because in there I
said that you yourself had already solved my problem a few weeks ago.
On 01/-10/-28163 02:59 PM, Modulok wrote:
Does anyone know of an efficient way of doing a weighted random
choice? (I don't even know what algorithms like this would be called.)
Preferably, something that doesn't grow exponentially with the number
of elements in the list, or the size of their resp
Josep M. Fontana wrote:
I am working with texts that are encoded as ISO-8859-1. I have
included the following two lines at the beginning of my python script:
!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
If I'm not mistaken, this should tell Python that accented characters
such as 'á', 'Á',
Sorry! Sorry! Sorry! I just found out this question had already been
answered by Steven D'Aprano in another thread! The trick was to add
'\w' besides [a-zA-Z].
Please, accept my apologies. I devote time to this project whenever I
have some free time. I got very busy with other things at some point
Hello Alan,
You mentioned the facade pattern. Could you please provide a basic
simple implementation
of this pattern in python?
Regards
Karim
On 12/23/2010 10:13 AM, Alan Gauld wrote:
"Rasjid Wilcox" wrote
I've been playing with dynamically generated classes. In particular:
class Clas
I am working with texts that are encoded as ISO-8859-1. I have
included the following two lines at the beginning of my python script:
!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
If I'm not mistaken, this should tell Python that accented characters
such as 'á', 'Á', 'ö' or 'è' should be cons
"Rasjid Wilcox" wrote
I've been playing with dynamically generated classes. In
particular:
class ClassMaker(object):
def __init__(maker_self, name):
maker_self.name = name
#
class Foo(object):
def __init__(self):
self.parent = maker_self
Hi all,
I've been playing with dynamically generated classes. In particular:
class ClassMaker(object):
def __init__(maker_self, name):
maker_self.name = name
#
class Foo(object):
def __init__(self):
self.parent = maker_self
def
17 matches
Mail list logo