Python executes the code to report an error and asks for advice.

-sharp!/usr/bin/python3
import sys
import datetime
import os
if __name__ == "__main__":
    while 1:
        startTime=datetime.datetime.now()
        main_path="./main.py"
        py=sys.executable
        os.system(r"{py} {main_path} {} {}".format(sys.argv[1],sys.argv[2]))
        endTime = datetime.datetime.now()
        endTime=datetime.datetime.now()
        intervalTime=endTime-startTime
        print("")
        print(intervalTime)
        break


shenjianlin@newdev:~/my_project/Espider/Espider(shenwei/spider_12_20)$ python3 supervisor.py crawl traveldaily
Traceback (most recent call last):
  File "supervisor.py", line 10, in <module>
    os.system(r"{py} {main_path} {} {}".format(sys.argv[1],sys.argv[2]))
KeyError: "py"
shenjianlin@newdev:~/my_project/Espider/Espider(shenwei/spider_12_20)$



Mar.03,2022

os.system (r'{py} {main_path} {0} {1} '.format (sys.argv [1], sys.argv [2], py=py, main_path=main_path)


py is an element of key, not arg

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea9ff2-47d73.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea9ff2-47d73.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?