[Tutor] "Ctrl-C (unix)" in python

W W srilyk at gmail.com
Thu Feb 19 00:38:39 CET 2009


On Wed, Feb 18, 2009 at 4:44 PM, pa yo <payo2000 at gmail.com> wrote:

> I am  running my Twitter>>Wiki bots in infinite loops but can't find
> an easy way to turn them off gracefully once I have started them. At
> the moment I have to go into the terminal window where they are
> running and type "Ctrl-C". (I am running Ubuntu 8.10 and python 2.5.2)
>
> I was thinking that I could get the bot script to read a text file at
> the start of the main loop and have a separate script writing the
> "exit" order to the same text file.... but before I get too involved
> with this I wanted to know if there  was an  built-in function to
> switch scripts on and off.
>

Unless you want to play with sockets, that's probably the easiest way to do
it that I know of.

-Wayne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090218/16d08e50/attachment.htm>


More information about the Tutor mailing list