If any error accrued restart job()
@HCWcoder I use this:
#!/usr/bin/env python3
# coding: utf-8
from subprocess import Popen
filename = 'script.py'
while True:
print("Starting " + filename)
p = Popen("python3 " + filename, shell=True)
p.wait()
@marcomokastyle
where should i put these ?
except KeyboardInterrupt:
session.end()
except WebDriverException:
pass
except:
import traceback
print(traceback.format_exc())
job()
while True:
schedule.run_pending()
time.sleep(1)
can you paste it inside my code ?
@HCWcoder No. Simply use this script, this restart your script forever if it fails. Change the name of script.py with your file, then execute this script instead.
@marcomokastyle oh :D thanks so muchh !!
@marcomokastyle how can i use this script in case im using this bot using env? instead of local pythin3 or python2. im using env on python2 to run this but after some time it stop so i want to use your script
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. > If this problem still occurs, please open a new issue
Most helpful comment
@HCWcoder No. Simply use this script, this restart your script forever if it fails. Change the name of script.py with your file, then execute this script instead.