Dec-11-2019, 01:36 AM
Here is my code:
this code is can run but.My problem is when I close thie python file it's will close all of python file that running in process
include the main python that run this code. My question is how can I close the specific python file?
1 2 3 4 5 6 7 8 9 10 11 12 |
if mybuffer = = "b'Python'" : print ( "Python File Opening" ) thislist = [r '"py_exe.py"' , r '"MQTT_pub.py"' ] #add path here for x in thislist: print (x) Popen( "python " + x) if mybuffer = = "b'Close_Py'" : thislist = [r '"python.exe"' ] # add path here for x in thislist: print (x) os.system( "TASKKILL /F /IM " + x) print ( "Python was closed" ) |
include the main python that run this code. My question is how can I close the specific python file?
