Hey all, i used the popen with getpid() option. working well so far, thanks to all of you. shawn
On Tue, Jul 28, 2009 at 12:11 PM, Mac Ryan<quasipe...@gmail.com> wrote: > I am not an expert, but if I got you correctly, what you want to achieve > is a "singleton": http://en.wikipedia.org/wiki/Singleton_pattern if you > watch at the sample implementation, there is a Python example too. > > Mac. > > On Tue, 2009-07-28 at 10:45 -0500, shawn bright wrote: >> Hey all, >> >> I have an app that runs in a GUI written in pygtk. It spawns several >> threads, and runs all the time. >> It is mission critical that we can never have two instances of this >> running at once. >> >> So, my question is, how can i write something that will know if there >> is an instance of that something already running? >> >> I am doing this in python 2.5 on Ubuntu, if that matters ( which i >> suspect it does ). >> >> thanks, >> shawn >> _______________________________________________ >> Tutor maillist - tu...@python.org >> http://mail.python.org/mailman/listinfo/tutor > > _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor