Re: [Tutor] remove not-empty directory

2006-03-30 Thread Tim Golden
[kakada] | Just a quick question again, how can I remove not-empty | directory in python? | | assumed I have the following directory: | | ( temp/a/b/ | temp/a/c/d.odt | temp/e.xml) | | I want to remove the whole temp/ directory. Look at the shutil module, and in particular at the rmtree f

[Tutor] remove not-empty directory

2006-03-30 Thread kakada
Hi all, Just a quick question again, how can I remove not-empty directory in python? assumed I have the following directory: ( temp/a/b/ temp/a/c/d.odt temp/e.xml) I want to remove the whole temp/ directory. Thanks :) da ___ Tutor maillist -

[Tutor] Apple Remote "Mouse"

2006-03-30 Thread Johnston Jiaa
I recently bought a Macbook Pro from Apple.  As it comes with a remote, I thought it would be great to use it as a mouse when not in Front Row.  The fast forward button would move the cursor to the left, the volume increase would move it up the screen, etc and the play button would serve as a "clic

Re: [Tutor] ASCII

2006-03-30 Thread andrew clarke
On Wed, Mar 29, 2006 at 01:51:30PM +0530, Kaushal Shriyan wrote: > > How do i use this ASCII values in my day to day activities, I am going > > through learning python, > > Its a very general question not related to python at all, I have a > minimum knowledge in ASCII just wanted to know how it i

[Tutor] XML node name and property

2006-03-30 Thread Keo Sophon
Hi all, How can I get a name of an XML node and and its property name and its property value? Thanks, Sophon ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Searching across .Py files for a particular string/ character

2006-03-30 Thread Kent Johnson
Janesh Ramakrishnan wrote: > Hi Folks, > > I was wondering what would be the best way to look up a string across > different files in the Python interpreter (PythonWin 2.4). The find function only finds files within currently open files. If I have a folder of .py scripts and need to look up a spe

Re: [Tutor] Searching across .Py files for a particular string/character

2006-03-30 Thread David Heiser
Here's a simple Python script that will do it. It's not very sophisticated, but it's easy to modify for special cases. import os, string def Find(TargetString, DIR, Names): for Name in Names: if Name != "Search.py": try: TargetFile = DIR + "/" + Name

[Tutor] Searching across .Py files for a particular string/ character

2006-03-30 Thread Janesh Ramakrishnan
Hi Folks, I was wondering what would be the best way to look up a string across different files in the Python interpreter (PythonWin 2.4). The find function only finds files within currently open files. If I have a folder of .py scripts and need to look up a specific keyword or string among al

Re: [Tutor] number of nodes

2006-03-30 Thread Kent Johnson
kakada wrote: > Hello everyone, > > textp = xmldoc.getElementsByTagName('text:p') > > from the example above, How can I know how many node are there? len(textp), maybe? Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/list

Re: [Tutor] Program for outputing the letter backward

2006-03-30 Thread Hoffmann
--- Ed Singleton <[EMAIL PROTECTED]> wrote: > On 29/03/06, Hoffmann <[EMAIL PROTECTED]> wrote: > > --- John Fouhy <[EMAIL PROTECTED]> wrote: > > > > > On 29/03/06, Hoffmann <[EMAIL PROTECTED]> > wrote: > > > > vehicle='car' > > > > index = vehicle[-1] #the last letter > > > > index_zero = ve

Re: [Tutor] Turnkey Python on a USB stick

2006-03-30 Thread Steve Slevinski
Hey Michael Sparks, You said you were interested in my Turnkey Python on a USB stick so I thought I'd tell you about it. It's going very well. I'm just putting the polish on it now. I have 2 main USB sticks: 1 for development and 1 for distribution to end users. My development USB can be pl

[Tutor] OT: Tutor Digest and Outlook 2003

2006-03-30 Thread Mike Hansen
The company I work for is moving to Outlook 2003 and Exchange server. I used to use Thunderbird. Anyway, when digest messages show up in Outlook 2003, all the posts are attachments. Does anyone know how to get them to display in-line? Thanks, Mike ___

Re: [Tutor] for loops and exceptions

2006-03-30 Thread Kent Johnson
Matthew White wrote: > Hello, > >>From a general style and/or programmatic perspective, which is a "better" > way to write this bit of code? Hmm, neither? > > try: > (dn, attrs) = conn.search_s(search_base, search_scope, search_filter, > search_attrs): > except Exception, e: > warn_

Re: [Tutor] Multi-thread environments

2006-03-30 Thread Kent Johnson
Liam Clarke wrote: > Hi all, > > I'm working in my first multi-threaded environments, and I think I > might have just been bitten by that. > > class Parser: > def __init__(self, Q): > self.Q = Q > self.players = {} > self.teams = {} > > def sendData(self): > if not se

[Tutor] Multi-thread environments

2006-03-30 Thread Liam Clarke
Hi all, I'm working in my first multi-threaded environments, and I think I might have just been bitten by that. I having issue with one method in a parser of mine. Only the code I think is causing the issue is included below, I can do a full post to RAFB if requested, but there's a bit of it. Th

Re: [Tutor] Program for outputing the letter backward

2006-03-30 Thread Ed Singleton
On 29/03/06, Hoffmann <[EMAIL PROTECTED]> wrote: > --- John Fouhy <[EMAIL PROTECTED]> wrote: > > > On 29/03/06, Hoffmann <[EMAIL PROTECTED]> wrote: > > > vehicle='car' > > > index = vehicle[-1] #the last letter > > > index_zero = vehicle[0] #the first letter > > > > > > while index >= index

Re: [Tutor] How does it function

2006-03-30 Thread Steve Nelson
On 3/30/06, Terry Carroll <[EMAIL PROTECTED]> wrote: > On Wed, 29 Mar 2006, Steve Nelson wrote: > > > Simple answer - any python program you write is effectively a > > 'module'. Modules have an attribute __name__. If you've imported the > > module from elsewhere, the __name__ is set to the name