[Tutor] detect 64-bit windows

2006-06-16 Thread Sean Lee
In Python, how to do that ?   sys.platform only gives 'win32', no info about 32-bit or 64 bit ?   Thanks. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] WinXP IDLE -> open file : how-to change default directory ?

2006-06-16 Thread Matthew Webber
Try right-clicking on the shortcut, select properties, and change the "start in" value. Matthew P.S. When posting to the list, please use plain text format. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of learner404 Sent: 15 June 20

Re: [Tutor] lambda and creating GUIs

2006-06-16 Thread Alan Gauld
>I have been reading though the PyGTK tutorial. > Can anyone explain how lambda is being used in this > statement: > > button.connect("clicked", lambda w: gtk.main_quit()) lambda is being used to create an anonymous function. The code could be rewritten like this: def f(w): gtk.main_quit() butto

Re: [Tutor] XML: Expletive Deleted (OT)

2006-06-16 Thread Alan Gauld
> [ The only SOA/XML book that addresses this side of XML usage > is the excellent "SOA - A Field Guide" by Peter Erls. Erls also > suggests some mitigating strategies to get round it.] Oops, don't rely on memory... That is Thomas Erl not Peter Erls. And of course there may be other SOAP/XML boo

[Tutor] Writing to a remote file

2006-06-16 Thread kieran flanagan
Hi I want to run a script on one machine and log output messages to a remote file located on another machine. Is there any easy method of doing this ?. Thanks Kieran-- "Behind every great man, there is a great woman. Behind that woman is Mr.T." ___ Tut

Re: [Tutor] Writing to a remote file

2006-06-16 Thread Kent Johnson
kieran flanagan wrote: > Hi > > I want to run a script on one machine and log output messages to a > remote file located on another machine. Is there any easy method of > doing this ?. Depends on the details, I suppose... If the remote file is on a network file system accessible to the machine

[Tutor] Delete directories recursively

2006-06-16 Thread Amresh Kulkarni
Hi,I need to delete a directory and its sub directories. However all dir's, sub dir;s and files have read only access. How do i do this efficeintly using the os.walk command. I cannot run this command on the dir as it gives me an error due to the read only attribute. Is there any other way to do th

Re: [Tutor] Delete directories recursively

2006-06-16 Thread Kent Johnson
Amresh Kulkarni wrote: > Hi, > > I need to delete a directory and its sub directories. However all dir's, > sub dir;s and files have read only access. How do i do this efficeintly > using the os.walk command. > I cannot run this command on the dir as it gives me an error due to the > read only

Re: [Tutor] Delete directories recursively

2006-06-16 Thread Matthew White
You must change the directory and file permissions before attempting to remove them; even if you are using a python script. Take a look at os.chmod() -mtw On Fri, Jun 16, 2006 at 10:26:34AM -0500, Amresh Kulkarni ([EMAIL PROTECTED]) wrote: > Hi, > > I need to delete a directory and its sub di

Re: [Tutor] Writing to a remote file

2006-06-16 Thread Lloyd Kvam
On Fri, 2006-06-16 at 14:47 +0100, kieran flanagan wrote: > Hi > > I want to run a script on one machine and log output messages to a > remote file located on another machine. Is there any easy method of > doing this ?. http://docs.python.org/lib/module-logging.html If the remote machine is a fi

Re: [Tutor] Writing to a remote file

2006-06-16 Thread Kent Johnson
Lloyd Kvam wrote: > On Fri, 2006-06-16 at 14:47 +0100, kieran flanagan wrote: >> Hi >> >> I want to run a script on one machine and log output messages to a >> remote file located on another machine. Is there any easy method of >> doing this ?. > Scanning the logging module docs, it looks like you

[Tutor] Machine Vs. Human Parsing (Was: XML: Expletive Deleted) (Way OT!)

2006-06-16 Thread Carroll, Barry
Greetings: > -Original Message- > Date: Fri, 16 Jun 2006 00:05:41 +0100 > From: "Alan Gauld" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] XML: Expletive Deleted (OT) > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > > Just picked this up after being out for most of the week... > >

Re: [Tutor] Delete directories recursively

2006-06-16 Thread John Corry
Amresh,   I had this problem a few months back.  I approached it backwards.  Maybe not the right way to do it.  I removed all the files and directories and then had my exception handle the file if it was read only.  The exception  handler changes the file from read-only to not read only and

Re: [Tutor] Delete directories recursively

2006-06-16 Thread Kent Johnson
John Corry wrote: > > Amresh, > > I had this problem a few months back. I approached it backwards. Maybe > not the right way to do it. I removed all the files and directories and > then had my exception handle the file if it was read only. The > exception handler changes the file from re

Re: [Tutor] Delete directories recursively

2006-06-16 Thread Amresh Kulkarni
Thanks guys,Error handling seems to be a nice idea to approach this problem. i checked Kent's code and it works fine.I was using a more crude method.def removeDir(dirName) :    #Remove any read-only permissions on file.     removePermissions(dirName)    for name in os.listdir(dirName):    file

Re: [Tutor] Delete directories recursively

2006-06-16 Thread Alan Gauld
> I need to delete a directory and its sub directories. However all > dir's, sub > dir;s and files have read only access. How do i do this efficeintly > using > the os.walk command. You can'ty since the reasoin the files are read-only is to prevent them being over-written or deleted! You need t

Re: [Tutor] Machine Vs. Human Parsing (Was: XML: Expletive Deleted)(Way OT!)

2006-06-16 Thread Alan Gauld
> > Almost anything beats the human eye IME :-) > > Actually if you must use eyes do so on a hex dump of the file, > > that > > is usually reliable enough if you can read hex... > If I gave the impression that the human eye is the only useful means > of > examining and verifying stored data, I ap

Re: [Tutor] lambda and creating GUIs

2006-06-16 Thread Christopher Spears
I understand this: > > def f(w): gtk.main_quit() > button.connect("clicked", f) > > lambda simply saves cluttering up the code with lots > of tiny function > derfinitions which are never referred to apart from > in the binding > operation. > Now my question is what is "w"? What is being passe

Re: [Tutor] lambda and creating GUIs

2006-06-16 Thread John Fouhy
On 17/06/06, Christopher Spears <[EMAIL PROTECTED]> wrote: > I understand this: > > > > def f(w): gtk.main_quit() > > button.connect("clicked", f) > > > Now my question is what is "w"? What is being passed > to the function? I don't know GTK, but I would guess some kind of event class. Other GUI