[Tutor] Stopping a webservice

Alan Gauld alan.gauld at btinternet.com
Thu Oct 21 00:50:24 CEST 2010

"Timo" <timomlists at 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 
server which ises it to referenbce the connection object - a 
might be useful here...

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

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


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list