Re: backup with python

2008-09-16 Thread Manuel Ebert
You may want to look into http://www.bigpaul.org/burn/ > Hi ! > I need some help to create backup with python. > I want to backup some bases on DVD - RW . > How i make this with python ? > I want to use python because the program is write on python . > > Thank you ! > -- > http://mail.python.org/m

Re: Enumerating ordered expat attributes with tuplets?

2008-09-11 Thread Manuel Ebert
x27;run')] and furthermore >>> for a, b in zip(my_list[0:len(a):2], my_list[1:len(a):2]): ... print a, b ... tree hug flower hug bear run or the slightly less obfuscated: >>> for index in range(0, len(my_list), 2): ... print my_list[index], my_list[index + 1] ...

Re: Enumerating ordered expat attributes with tuplets?

2008-09-11 Thread Manuel Ebert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Andy, by the looks of it I'd say that the problem is that the second parameter you passed to start_element is not a dictionary at all (the clue is in the "AttributeError: 'LIST' object" ...). >>> d = ['tree', 'house'] >>> start_element("Thin

Re: Know if a object member is a method

2008-09-01 Thread Manuel Ebert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Luca, use type(something).__name__ , e.g. >>> def x(): >>>pass >>> class C: >>>pass >>> c = C() >>> type(x).__name__ == 'function' True >> type(C).__name__ == 'classobj' True >> type(c).__name__ == 'instance' True On Sep

Re: Command lime code

2008-09-01 Thread Manuel Ebert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Okay, I'll take I wild guess: By "command lime code" you did not refer to the algorithmic domination of citrus fruit, but rather to that window with the tiny blinking cursor and loads of text in white on black. Also by 'chdir' you probably mean

Most pythonic way of weighted random selection

2008-08-30 Thread Manuel Ebert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dear list, who's got aesthetic advice for the following problem? I've got some joint probabilities of two distinct events Pr(X=x, Y=y), stored in a list of lists of floats, where every row represents a possible outcome of X and every float in a

Re: Split function for host:port in standard lib

2008-08-26 Thread Manuel Ebert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 AFAIK port names cannot contain any colons, so python2.5's 'host:port' .rsplit(':') should do the job. On < 2.5 you probably need to do something like s = addr.rindex(':') host, port = addr[:s], addr[s+1:] Best, Manuel On Aug 26, 2008, at 1:31

Re: newbie question

2008-08-25 Thread Manuel Ebert
Hi sharon, the problem is here that a = 12,123 will actually create a tuple with two elements (namely 12 and 123): >> a = 12,123 >> a (12, 123) Converting this to a string yields '(12, 123)', which is not what you want (sounds confusing, bit soon you'll see how many amazing things can be don

Re: newbie question

2008-08-25 Thread Manuel Ebert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi sharon, as I understand, you want to remove certain characters of a string. Try: number = int(fetched_number.replace(',', '')) this will first remove any , characters and then convert the string into an integer. Best, Manuel On Aug 25, 2008