Graceful exiting of a program in Python?
<p>Hey all, I have a script that runs as a </p>

<pre><code>while True:
  doStuff()
</code></pre>

<p>What is the best way to communicate with this script if I need to stop it but I don't want to kill it if it is in the middle of an operation?</p>

<p>Thanks!</p>
