Anonymous user
Determine if only one instance is running: Difference between revisions
Determine if only one instance is running (view source)
Revision as of 05:23, 9 December 2007
, 16 years ago→{{header|Python}}
m (Added "more proper"(?) method) |
|||
Line 20:
while frame.f_back:
frame = frame.f_back
if not os.system('(( $(ps -aef | grep python | grep \'[' + frame.f_code.co_filename[0] + \
']' + frame.f_code.co_filename[1:len(frame.f_code.co_filename)] + '\' | wc \
-l) > 1 ))'):
Line 36:
while frame.f_back:
frame = frame.f_back
if not os.system('(( $(ps -aef | grep python | grep \'[' + frame.f_code.co_filename[0] + \
']' + frame.f_code.co_filename[1:len(frame.f_code.co_filename)] + '\' | wc \
-l) > 1 ))'):
|