[Tutor] Fwd: How to get a string from a DOM Text node ?

2008-05-25 Thread Moishy Gluck
-- Forwarded message -- From: Moishy Gluck <[EMAIL PROTECTED]> Date: Sun, May 25, 2008 at 5:54 PM Subject: Re: [Tutor] How to get a string from a DOM Text node ? To: Zameer Manji <[EMAIL PROTECTED]> xml does not allow text in a node. So you kneed to place a nod

[Tutor] Fwd: syntax question

2008-05-21 Thread Moishy Gluck
-- Forwarded message -- From: Moishy Gluck <[EMAIL PROTECTED]> Date: Wed, May 21, 2008 at 12:00 PM Subject: Re: [Tutor] syntax question To: Eric Abrahamsen <[EMAIL PROTECTED]> You appear to be referring to list comprehension. Here is a link to list comprehension i

Re: [Tutor] String Replacement Question

2008-05-21 Thread Moishy Gluck
On Wed, May 21, 2008 at 10:29 AM, Moishy Gluck <[EMAIL PROTECTED]> wrote: > >>> "%s " %st*3 > 'String String String ' > ^ > If you look closely at the end of the string there is an extra space. >

Re: [Tutor] String Replacement question

2008-05-21 Thread Moishy Gluck
Some other solutions might be >>> animal = 'cat' >>> " ".join((animal, ) * 4) 'cat cat cat cat' >>> animal = 'cat' >>> print " ".join((animal, ) * 4) cat cat cat cat >>>#If you need the string injected into another string >>> print "My %s's name is ginger." % (" ".join((animal,) * 4)) My cat cat c

Re: [Tutor] timed functions? Timeouts?

2008-05-20 Thread Moishy Gluck
#A single " * " accepts arbitrary amount of unnamed parameters. Two " ** " accepts an arbitrary amount of unnamed parameters. # Using asterisk. def FuncOne(*list, **dict): for color in list: print color print "" for [color, value] in dict.items(): print color.ljust(

Re: [Tutor] Getting started with Python

2008-05-16 Thread Moishy Gluck
On Fri, May 16, 2008 at 11:20 AM, Moishy Gluck <[EMAIL PROTECTED]> wrote: > You need to place a "__init__.py" file in a directory you want to reference > in an import statement. > > I don't believe the content of the file is important but you can place code &