擅长:python、mysql、java
<p>有几种方法可以解决这个问题。其中:</p>
<ul>
<li>libunique-专门为此设计的库</li>
<li>dbus-内部通信系统</li>
</ul>
<p>其中许多在<a href="https://stackoverflow.com/questions/2261997/how-can-i-detect-what-other-copy-of-python-script-is-already-running">this post</a>的答案中描述。在</p>
<p>唯一实例的配方是<a href="http://code.activestate.com/recipes/474070/" rel="nofollow noreferrer">here</a>。在</p>