8 lines
339 B
Python
8 lines
339 B
Python
import __main__, os
|
|
|
|
def isOnlyInstance():
|
|
# Determine if there are more than the current instance of the application
|
|
# running at the current time.
|
|
return os.system("(( $(ps -ef | grep python | grep '[" +
|
|
__main__.__file__[0] + "]" + __main__.__file__[1:] +
|
|
"' | wc -l) > 1 ))") != 0
|