Only allow 1 instance of a python script
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/380870/python-single-instance-of-program">Python: single instance of program</a>  </p>
</blockquote>



<p>What is the best way to insure that only 1 copy of a python script is running?   I am having trouble with python zombies.  I tired creating a write lock using <code>open("lock","w")</code>,  but python doesn't notify me if the file already has a write lock, it just seems to wait.  </p>
