我需要在无限循环中永远运行我的Python程序.
目前我正在运行它 -
#!/usr/bin/python
import time
# some python code that I want
# to keep on running
# Is this the right way to run the python program forever?
# And do I even need this time.sleep call?
while True:
time.sleep(5)
Run Code Online (Sandbox Code Playgroud)
有没有更好的方法呢?或者我甚至需要time.sleep打电话?有什么想法吗?