I wrote a Python script to use Twitter Stream API. Sometime error occurs and it stops streaming.
What can I do to make the script restart automatically? Is it something about bash?
I am not using Linux. Appreciate any solution for Windows. Thank you.
You can either:
Bash:
while true; do ./your_script.py; done
Windows CMD:
:loop
./your_script.py
goto loop
def main():
while True:
try:
your_logic()
except:
pass
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.