php - How to check a python script (test.py)is running or not on windows 10 -


i'm trying setup socket connection between python , php. python function server , php client.

i have python script (test.py) running form php.

`python test.py` 

how check (test.py) running or not each time before running php.how stop if script running.

how can check script(test.py) running or not in task manager or anywhere else? on windows10.

this unorthodox, if want handle basic lock in windows cmd, can change execution line to:

dir .lock || echo lock > .lock && python test.py && del .lock 

this code create lock file if not exist, , start python script. if lock file exists nothing.

the lock file deleted after python script executed can have 1 python script executing @ given time.

you might want add absolute paths towards proper python script or temporary lock folder.

note might have deadlock situation if python interpreter runs on error.


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -