From 90e189ad066e069da2bd81da4b7dbe4d7b747ff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=B3nya=20M=C3=A1rton?= Date: Mon, 20 Jul 2020 11:33:51 +0200 Subject: [PATCH] was completely working for a while --- run.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/run.py b/run.py index 430183c..b9b1faa 100644 --- a/run.py +++ b/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)