Determine if only one instance is running: Difference between revisions

m
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 ))'):
Anonymous user