i have a python script that can be runned in some seconds and some times it takes some minutes to be finished. im trying to make a script that prevents that my python code to run twice at same time
i tryed
print("python mycode.py" in (p.name() for p in psutil.process_iter()))
or
print("mycode.py" in (p.name() for p in psutil.process_iter()))
but its only works for linux how can i change it to work on linux and windows?