Re: [Tutor] tree/node class/module

2008-01-15 Thread cedric briner
usefull page > http://www.velocityreviews.com/forums/t355467-tree-and-graph-structures-in-python.html > thanks again Ced. -- Cedric BRINER Geneva - Switzerland ___ Tutor maillist - Tutor@python.org http://mail.python.org/m

[Tutor] tree/node class/module

2008-01-15 Thread cedric briner
idn't found any class/modules which implements trees, with some comments, and small examples. Am I just blind ??? I'm looking for a tree of object which will give me stuff like: - sibling - parent - children - find - insert Do you have any pointers ?? Ced. -- Cedri

Re: [Tutor] uncomprehension on RE

2007-09-20 Thread cedric briner
Stephen Nelson-Smith wrote: > On 9/20/07, cedric briner <[EMAIL PROTECTED]> wrote: > >> To let you know, I'm writing a script to generate bind9 configuration >> from a nis hosts table. So I was trying in a one re to catch from this: >> >> [ ...] [#

Re: [Tutor] uncomprehension on RE

2007-09-20 Thread cedric briner
Kent Johnson wrote: > cedric briner wrote: >> To let you know, I'm writing a script to generate bind9 configuration >> from a nis hosts table. So I was trying in a one re to catch from this: >> >> [ ...] [# comment] >> e.g: >> 10.12.23.45 host

Re: [Tutor] uncomprehension on RE

2007-09-19 Thread cedric briner
Kent Johnson wrote: > cedric briner wrote: >> Hello, >> >> I do not understand the behaviour of this: >> >> import re >> re.search('(a)*','aaa').groups() >> ('a',) >> >> I was thinking that the ``*''

[Tutor] uncomprehension on RE

2007-09-19 Thread cedric briner
, 'a') Is there something I'am missing ? Ced. -- Cedric BRINER Geneva - Switzerland ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] ldap client

2006-03-14 Thread Cedric BRINER
debian/sarge hello, I'm wanting to interogate an ldap server to fetch informations. so I'm looking for a python2.4 ldap client. And the only I've found is python2.4-ldaptor. Does some of you knows an good ldap client which use SSL ? Ced. -- Cedric BRINER Genev

[Tutor] cas and python

2005-12-07 Thread Cedric BRINER
hi, does one of you knows if there is a python module which implements CAS(Central Authentication Service): https://clearinghouse.ja-sig.org/wiki/display/CAS/Home thanks in advance Ced. -- Cedric BRINER Geneva - Switzerland ___ Tutor maillist

Re: [Tutor] Python DB

2005-09-22 Thread Cedric BRINER
I love sqlobject.org it this a wrapper between many sql implementation (mysql, postgresql..) and python. get a look. Ced. -- Cedric BRINER Geneva - Switzerland ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] IDEs

2005-09-20 Thread Cedric BRINER
what about eric3 ? http://www.die-offenbachs.de/detlev/eric3.html Ced. -- Cedric BRINER Geneva - Switzerland ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Basic class inheritance

2005-07-28 Thread Cedric BRINER
ss A(object): def __init__(self, blank=False, editable=True, name='foo'): self.blank = blank self.editable = editable self.name = name class B(A): def __init__(self, blank=True, editable=True, name='foo'): super(B, self).__init__(b

[Tutor] python learning

2005-07-28 Thread Cedric BRINER
pace. So the only way to destruct such module, will be within the module. I found that such module act has a singleton Ced. -- Cedric BRINER Geneva - Switzerland ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] SQL headache with column

2005-07-20 Thread Cedric BRINER
did you heard about sqlobject ? give a try...http://www.sqlobject.org/ Ced. -- Cedric BRINER ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] module with static global

2005-07-12 Thread Cedric BRINER
give an eyes to sqlobject.org. -- Cedric BRINER ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] python and database

2005-07-07 Thread Cedric BRINER
pgsql. Ced. -- Cedric BRINER ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] interactif or not

2005-06-07 Thread Cedric BRINER
hon, file objects have an isatty() > method that will return True or False. > > import sys > isinteractive = sys.stdin.isatty() > if isinteractive: > ... > else: > ... > tested and it works ! Ced. -- Cedric BRINER ___

[Tutor] interactif or not

2005-06-03 Thread Cedric BRINER
Ced. -- Cedric BRINER ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Looking for HOWTO's

2005-06-03 Thread Cedric BRINER
Maybe this is Off-Topic but I found recently a perfect repository of python tutorials at: http://www.awaretek.com/tutorials.html Ced. -- Cedric BRINER ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Testing for commandline args

2005-05-17 Thread Cedric BRINER
> Also, I hear that optparse is much better than getopt. this is a true pleasure to work with optparse. It was included in python2.3 and was primarly called python-optik Ced. -- Cedric BRINER ___ Tutor maillist - Tutor@python.org h

Re: [Tutor] creation of a module

2005-05-17 Thread Cedric BRINER
ou do just want to export a single set of services from a > single import it would be much simpler to just put them all > in a single module! And then you can hide the exposed names > using the Python naming convention of prefixing with '_' > or ' __'. > > Of course if its a very large set of services a package > is better, but then you probably should expose the sub modules > too. NAmespaces are one of Pythons best features - they are > simple to use and very effective both in controlling program > structure and in aiding debugging, its probabnly best to use > them as intended rather than trying to force them to work > differently. > > All IMHO of course! :-) > > Alan G thanks for your time. Ced. -- Cedric BRINER ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] creation of a module

2005-05-13 Thread Cedric BRINER
lassname: #filename='a', classname='classA' filename=classname.replace('class','').lower() #from filename import classname #can't do this module=__import__(filename, gloabls(), locals(), [classname]) classDefinition=getattr(module,classname) assign(classname,classDefinition) In this way, when I'll do an import FWobs I'll get: MyModule.classA .classB .classC . . thanks for your help ! -- Cedric BRINER ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] creation of a module

2005-05-13 Thread Cedric BRINER
nction like: assign('x',3) -- Cedric BRINER ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] incomprehension in type of classes.

2005-04-23 Thread Cedric BRINER
aaah... I din't know that there was two kinds of classes. So you mean that, now the new style object should be like: class A(object): pass >>> class A: pass ... >>> class B(object): pass ... >>> a=A() >>> b=B() I see that dir (b) compare to di

[Tutor] incomprehension in type of classes.

2005-04-22 Thread Cedric BRINER
at you are currently debugging in. Quesion 2 - why type of (CYear(2005)) and type(CYearDerived) doesn't give the same type ??? -- Cedric BRINER ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] dictionary2unicode and unicode2dictionnary

2005-04-08 Thread BRINER Cedric
7;c' In fact, what I really need is the ability to push a dictionary (which can contain unicode) in a postgres database. and the sql command given are in unicode. Thus I need to transform a dictionnary--to-->unicode and then, do the inverse operation unicode--to-->dictionnary Cedric BRINER ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] OO newbie

2005-04-08 Thread BRINER Cedric
function to initialize a dictionnary so dict.__init__(self...) initialize the dictionnary `self'. Which work because self derive from a dictionnary... I got it ! I was really lost because I was not clearly making a difference between the class: ``

[Tutor] OO newbie

2005-04-07 Thread briner
impleUnderscore 3- in the definition of getCount we saw that the parameter is `cls'. what does that mean??? 4- I just realize when writing this email that SuperDict is also an object. and type(SuperDict) WOW Cedric BRINER ___ Tutor maillist - Tu

Re: [Tutor] pickle in unicode format

2005-04-07 Thread BRINER Cedric
1, in ? > UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: > ordinal not in range(128) > ## this is it! > but again, I hate guessing. *grin* Sorry for this :( > Show us exactly what you're seeing as an error message: don't just

[Tutor] pickle in unicode format

2005-04-05 Thread BRINER Cedric
I'd like to *serialize* it with pickle and that the output format will be of type unicode. unicode(pickle.dumps(a)) doesn't work ! or pickle.dumps(a,protocol=2,bin='V') doesn't seem to work :( what am I doing wrong ?? Cedric BRINER ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] unicode type on cgi script

2005-03-15 Thread BRINER Cedric
e" sys.stdout.flush() content = u'c\xe9dric' print content #- when I invoke it from my xterm, I get: > python cedric.py Content-Type: text/html hipo'potame cédric but the same does not work on apache: /home/system/briner/obsadminwww/cedric.py