[Tutor] os.path.walk

2006-08-22 Thread nimrodx
Hi All, I was wondering if anyone had used os.path.walk within a class or not, and what are the pitfalls... What has got me worried is that the function called by os.path.walk must be a method of the class. Now this means it will have something like this as a def: def func_called_by_walk(self

Re: [Tutor] tkinter events:

2006-08-22 Thread Zsiros Levente
Luke Paireepinart wrote: > Zsiros Levente wrote: > >> [snip code] >> *def* handler(event): >> *if* buttonpressed == 1 : >> /#if the mousebutton is pressed and moved, circles should >> appear, but they do not/ >> can.create_oval(event.x-r, event.y-r, event.x+r, event.y+r, >> f

Re: [Tutor] Limiting Characters

2006-08-22 Thread Michael Lange
On Mon, 21 Aug 2006 13:19:54 -0400 "Marcus Dean Adams" <[EMAIL PROTECTED]> wrote: > I_m fairly new to python, I_ve been dabbling in it for school and I have a > question. I_ve written a few programs using graphical windows with input > boxes such as a stopwatch, temperature converter, etc. I_ve

Re: [Tutor] tkinter events:

2006-08-22 Thread Zsiros Levente
You're right, that I pressed reply instead of reply-to-all, so the list didn't see my response. But this way you got my mail twice. Isn't that annoying? Other maillist servers used to use the reply-to tag in the message header. Luke Paireepinart wrote: > Zsiros Levente wrote: > >> [snip code]

Re: [Tutor] tkinter events:

2006-08-22 Thread Zsiros Levente
Zsiros Levente wrote: >Luke Paireepinart wrote: > > > >>Zsiros Levente wrote: >> >> >> >>>[snip code] >>>*def* handler(event): >>>*if* buttonpressed == 1 : >>>/#if the mousebutton is pressed and moved, circles should >>>appear, but they do not/ >>>can.create_oval(event.x

Re: [Tutor] [Fwd: [Fwd: self-modification]]

2006-08-22 Thread Zsiros Levente
Why does the python shell says this: >>> print exec.__doc__ File "", line 1 print exec.__doc__ ^ SyntaxError: invalid syntax While it works with "eval". Anyway, I'm quite impressed with the resposiveness of this list. Thanks a lot. Zsiros Levente wrote: > > > Sorry, the s

Re: [Tutor] os.path.walk

2006-08-22 Thread Kent Johnson
nimrodx wrote: > Hi All, > > I was wondering if anyone had used os.path.walk within a class or not, > and what are the pitfalls... > > What has got me worried is that the function called by os.path.walk > must be a method of the class. > Now this means it will have something like this as a def:

Re: [Tutor] [Fwd: [Fwd: self-modification]]

2006-08-22 Thread Kent Johnson
Zsiros Levente wrote: > Why does the python shell says this: > > print exec.__doc__ > File "", line 1 > print exec.__doc__ > ^ > SyntaxError: invalid syntax > > > While it works with "eval". exec is a statement that is interpreted by the compiler and compil

[Tutor] Larger GUI design ?

2006-08-22 Thread Dave S
I have managed to write a small GUI app, it had a frm_app.py from eric3s QT designer & a dlg_app.py which defined a class that inherited the frm_app.py class ... all AOK I am now on a more ambitious project. There will be a main app screen, some dialogue screens for more info etc and a backend

Re: [Tutor] [whitelist] Re: regular expressions question

2006-08-22 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Nimrodx, In case you haven't found a solution yet, I developed a program to encode/decode stuff similar to this. You may want to take a look at it at http://home.townisp.com/~arobert/python/file_encoder.py nimrodx wrote: > Hi Alan, > > I fou

Re: [Tutor] os.path.walk

2006-08-22 Thread Alan Gauld
> What has got me worried is that the function called by os.path.walk > must be a method of the class. > Now this means it will have something like this as a def: > > def func_called_by_walk(self, arg, directory, names): > > Will this work with os.path.walk with that definition? No, but you can w

Re: [Tutor] os.path.walk

2006-08-22 Thread Alan Gauld
> Yes, that is the right way to do it and it will work fine. Something > like > > class Walker(object): > def walk(self, base): >os.path.walk(base, self.callback, None) > > What happens is, when Python looks up self.callback it converts the > method to a "bound method". Aargh! I should hav

Re: [Tutor] [Fwd: [Fwd: self-modification]]

2006-08-22 Thread Alan Gauld
> Why does the python shell says this: > print exec.__doc__ > File "", line 1 >print exec.__doc__ > ^ > SyntaxError: invalid syntax exec, like print, is a statement, or command, not a function. You get the same response if you try >>> print print.__doc__ or >>> help(pr

Re: [Tutor] Larger GUI design ?

2006-08-22 Thread Alan Gauld
> I am now on a more ambitious project. There will be a main app > screen, some > dialogue screens for more info etc and a backend script analysing a > database > which will take some time to run. > > How to fit the GUI around it ? > > If I have my dlg_app.py inhereting frm_app.py all is well un

Re: [Tutor] Larger GUI design ?

2006-08-22 Thread Dave S
On Tuesday 22 August 2006 17:15, Alan Gauld wrote: > > I am now on a more ambitious project. There will be a main app > > screen, some > > dialogue screens for more info etc and a backend script analysing a > > database > > which will take some time to run. > > > > How to fit the GUI around it ? >

Re: [Tutor] tkinter events:

2006-08-22 Thread Danny Yoo
> def handler(event): > if buttonpressed == 1 : > /#if the mousebutton is pressed and moved, circles should > appear, but they do not/ > can.create_oval(event.x-r, event.y-r, event.x+r, event.y+r, > fill="orange") > lab.config(text='buttonpressed=' + str(bu

Re: [Tutor] how to get an email attachment

2006-08-22 Thread wesley chun
On 8/21/06, shawn bright <[EMAIL PROTECTED]> wrote: > Yes, indeed. I found in the essential reference book. It looks like it works > in the email module also. I will try a few things out here and let you know > how it goes. > thanks. > > shawn > > > On 8/21/06, Alan Gauld <[EMAIL PROTECTED]> wrote

Re: [Tutor] Low level socket and threading code in python in HUGEwebsites -

2006-08-22 Thread wesley chun
On 8/18/06, anil maran <[EMAIL PROTECTED]> wrote: > thanks alan it is very enlightening > can one of you guys who have experience building sites > such as yahoo mail and stuff, explain what parts of a > webserver needs to be multithreaded > > > > Because of the low-level socket and threading code >

[Tutor] [OT] Re: Limiting Characters

2006-08-22 Thread Brian van den Broek
Luke Paireepinart said unto the world upon 21/08/06 03:48 PM: > Sort of how my last name is 12 characters long, but on some apps that > only have a 12 character array (with the actual length being 11 because > of the null terminator) the last letter of my name gets truncated. > This doesn't

Re: [Tutor] How to teach Python

2006-08-22 Thread Elaine
Thanks to everyone for your helpful answers! -Elaine __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Tutor maillist - Tutor@python.org http:/

[Tutor] How to use

2006-08-22 Thread emman uel
How to use this program? Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1ยข/min.___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] How to wrap this line of code?

2006-08-22 Thread Dick Moores
I have this long print statement in a script: print "Initial integer of first sequence with number of terms of %d or more was %s (%d)" % (length, intCommas(n_for_max_c), n_for_max_c) It's one line of code, and too long. How can I wrap it so that it is written in the code as 2 lines? (I hope I

Re: [Tutor] How to wrap this line of code?

2006-08-22 Thread Bob Gailer
Dick Moores wrote: > I have this long print statement in a script: > > print "Initial integer of first sequence with number of terms of %d > or more was %s (%d)" % (length, intCommas(n_for_max_c), n_for_max_c) > > It's one line of code, and too long. How can I wrap it so that it is > written in

Re: [Tutor] How to wrap this line of code?

2006-08-22 Thread Dick Moores
At 11:10 PM 8/22/2006, Bob Gailer wrote: >Dick Moores wrote: >>I have this long print statement in a script: >> >>print "Initial integer of first sequence with number of terms of %d >>or more was %s (%d)" % (length, intCommas(n_for_max_c), n_for_max_c) >> >>It's one line of code, and too long. Ho