was completely working for a while
This commit is contained in:
parent
2b5d100b7e
commit
90e189ad06
9
run.py
9
run.py
|
|
@ -59,6 +59,8 @@ def l():
|
|||
def post(title, body, subreddit):
|
||||
try:
|
||||
reddit.subreddit(subreddit).submit(title, selftext=body)
|
||||
print('The scheduled post has been posted!')
|
||||
print('Press Ctrl+{0} to exit'.format('Break' if os.name == 'nt' else 'C'))
|
||||
pass
|
||||
except:
|
||||
print(f'Something went wrong. Maybe you don\'t have permission to post in r/{subreddit}. Please press CTRL+C to close the script!')
|
||||
|
|
@ -169,10 +171,5 @@ try:
|
|||
time.sleep(2)
|
||||
except (KeyboardInterrupt, SystemExit):
|
||||
# Not strictly necessary if daemonic mode is enabled but should be done if possible
|
||||
scheduler.shutdown()
|
||||
sched.shutdown()
|
||||
|
||||
# schedule.every().monday.at("17:12").do(uzenet)
|
||||
|
||||
# while True:
|
||||
# schedule.run_pending()
|
||||
# time.sleep(1)
|
||||
|
|
|
|||
Loading…
Reference in New Issue