Python: single instance of program on Windows using mutexes
<p>I create an executable using <a href="http://www.py2exe.org/" rel="nofollow noreferrer" title="py2exe">py2exe</a> in python.<br>
I was looking at this <a href="https://stackoverflow.com/questions/380870/python-single-instance-of-program">post</a> but unfortunately the answers were superficial.<br>
The first solution using <a href="https://stackoverflow.com/a/1265445/1538099">Tendo</a> but this works to limit 1 instance of application per user, and my app is being used in a Windows Server Environment where there are 20+ users loged in at a time.<br>
And the second solution offered <a href="https://stackoverflow.com/a/380876/1538099">Listening to a defined port</a> doesn't have examples of how it could be accomplished.<br>
So I decided to go for mutexes to prevent my app from running multiple times.<br>
So I currently use this <a href="http://code.activestate.com/recipes/474070-creating-a-single-instance-application/" rel="nofollow noreferrer">code</a> for using mutexes, but it doesn't have mutex detection between applications and Services.<br>
This <a href="https://stackoverflow.com/questions/20669917/one-instance-of-app-per-computer-how">post</a> shows how to accomplish mutexes, but doesn't show how its done in python.<br>
How could I use Mutexes to have single instance of program on Windows where the mutexes don't limit single instance of program on Windows, and has detection between applications and Services.</p>