"Timo" <timomli...@gmail.com> wrote

I have written a GUI and when I click the Quit-button, I do
"connection.shutdown = True", which works great.

The plans are to run this on my webserver. I created a webpage with a start and stop button, the starting works great. But how could I remember this class to call "class.shutdown = True" any given time when I press the stop
button?

There arec several ways but one would be to pass the connection
object ID as a cookie and then when Quiting usend the cookie data to the server which ises it to referenbce the connection object - a dictionary
might be useful here...

Thats assuming you havf multiple connection objects running, maybe even one per client sesssion. If its a global conmnection objerct then just store
it as a global object (maybe in its own module imported by all other
modules?)

There are several other options but those are probably the two simplest
depending on your use case.

HTH,

--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to