ダ
Size: a a a
ダ
A
ダ
d
A
A
d
A
A
d
S
d
S
S
A
import psutil
import subprocess as sp
import time
pid_list = []
pid = ''
argument = '...'
proc = sp.Popen(['python', 'main.py', argument], shell=True)
pid = str(proc.pid)
time.sleep(3) # <-- There no time.wait, but time.sleep.
while True:
time.sleep(2)
print(pid)
for proc in psutil.process_iter():
pid_list.append(str(proc.pid))
print(pid_list)
if pid not in pid_list:
proc = sp.Popen(['python', 'main.py', argument], shell=True)
pid = proc.pid
else:
pass
pid_list.clear()
A
ダ
A
A
A
import psutil
import subprocess as sp
import time
pid_list = []
pid = ''
argument = '...'
proc = sp.Popen(['python', 'main.py', argument], shell=True)
pid = str(proc.pid)
time.sleep(3) # <-- There no time.wait, but time.sleep.
while True:
time.sleep(2)
print(pid)
for proc in psutil.process_iter():
pid_list.append(str(proc.pid))
print(pid_list)
if pid not in pid_list:
proc = sp.Popen(['python', 'main.py', argument], shell=True)
pid = proc.pid
else:
pass
pid_list.clear()