[Stada] Script that will call you when Pokemon GO is released When I tried to plagiarize the above article and execute the script with cron The following error occurs when executing a command in the subprocess module of python
python poke_check.py
Traceback (most recent call last):
File "poke_check.py", line 47, in <module>
start()
File "poke_check.py", line 43, in start
subprocess.call("echo 'not open'")
File "/usr/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
http://stackoverflow.com/questions/18962785/oserror-errno-2-no-such-file-or-directory-while-using-python-subprocess-in-dj
Solved by the stackoverflow article above.
It seems that a flag is required when passing the command to be executed as a character string.
subprocess.call("(Command you want to execute)", shell=True)
Recommended Posts