Re: [Tutor] lambda and creating GUIs

2006-06-15 Thread John Fouhy
(resending to include Tutor -- sorry for the dupe, Christopher) On 16/06/06, Christopher Spears <[EMAIL PROTECTED]> wrote: > 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())

[Tutor] lambda and creating GUIs

2006-06-15 Thread Christopher Spears
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()) This code might put the statement in context: # Create "Quit" button 66 button = gtk.Button("Quit") 67 68

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

2006-06-15 Thread Alan Gauld
Just picked this up after being out for most of the week... "Carroll, Barry" <[EMAIL PROTECTED]> wrote in message > One reason to for choosing a human-readable format is the desire to > visually confirm the correctness of the stored data and format. Thats a very dangerous asumption, how do you d

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

2006-06-15 Thread learner404
On 15/06/06, Matthew Webber <[EMAIL PROTECTED]> wrote: Try right-clicking on the shortcut, select properties, and change the "startin" value.MatthewScary, I didn't know that windows had that ...Thanks very much Matthew ! P.S. When posting to the list, please use plain text format.__

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

2006-06-15 Thread learner404
Hello,On WinXP IDLE will always 'open' in Python24 folder at startup.A beginner friend of mine hate that (personally I use SPE) and I tried 'quickly' to find a way to configure that for him.I found all the .cfg files in idlelib and also the .idlerc folder in the "Documents and settings" but I don't

Re: [Tutor] Question about network server in python

2006-06-15 Thread Kent Johnson
Tino Dai wrote: > Hi there, > > I am wondering if somebody to could answer a question about > sockets. I have a socket that > is listening, and a client program connects to it. The client program > transfers a name over, and then disconnects from the socket. Now, how > that is done is usi

Re: [Tutor] Question about network server in python

2006-06-15 Thread Kent Johnson
Peter Jessop wrote: > I think the problem here is the 'break' statement. > Does it not put you outside the while loop whereas in order to keep > the server socket open you need it to loop forever. > > I also think that the s.accept should be inside the while loop. There are two loops, I think you

Re: [Tutor] Question about network server in python

2006-06-15 Thread Peter Jessop
import socket host = '' port = 57000 s=socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1) s.bind((host,port)) s.listen(5) while 1: client,addr=s.accept() client.send("Connected to the server\n") #if someCondition: # cliente.clo

Re: [Tutor] Question about network server in python

2006-06-15 Thread Peter Jessop
I think the problem here is the 'break' statement. Does it not put you outside the while loop whereas in order to keep the server socket open you need it to loop forever. I also think that the s.accept should be inside the while loop. ___ Tutor maillist

[Tutor] Question about network server in python

2006-06-15 Thread Tino Dai
Hi there,  I am wondering if somebody to could answer a question about sockets. I have a socket that is listening, and a client program connects to it. The client program transfers a name over, and then disconnects from the socket. Now, how that is done is using a socket.close() call to shut d

Re: [Tutor] Need info regd Singleton class implementation

2006-06-15 Thread Kent Johnson
Akanksha Govil wrote: > I need to implement a singleton class in python. > Please give me some refernce sites which can help me with the same. Singletons are not used that much in Python, perhaps because the general culture of "we're all adults here" is biased against enforcing usage patterns.

Re: [Tutor] Need info regd Singleton class implementation

2006-06-15 Thread Andre Roberge
On 6/15/06, Akanksha Govil <[EMAIL PROTECTED]> wrote: > hi, > > I need to implement a singleton class in python. > Please give me some refernce sites which can help me with the same. The online Python Cookbook is a good reference site. Here's the result from a search: http://aspn.activestate.com/

[Tutor] Need info regd Singleton class implementation

2006-06-15 Thread Akanksha Govil
hi,I need to implement a singleton class in python.Please give me some refernce sites which can help me with the same.Also i want to know to call a destructor for a singleton class.ThanksAkanksha __Do You Yahoo!?Tired of spam? Yahoo! Mail has the bes