Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ee66a0e

Browse files
author
Rami Janini
committed
Added a way to take user input for number of hours.
1 parent 8bab73f commit ee66a0e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

motivational_quotes_automation/motivate.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,18 @@ def create_notifier(data):
3939

4040

4141
def main_app():
42+
try:
43+
time_ = int(input('Repeat notification after (hours): '))
44+
except:
45+
print('''There was an error in the user input,
46+
make sure that ur input is only numbers''')
47+
sys.exit(0)
4248
while True:
43-
4449
check_availability()
4550
data = get_quote()
4651
create_notifier(data)
4752
print('Sent notification.')
48-
time.sleep(2 * 3600)
53+
time.sleep(time_ * 3600)
4954

5055

5156
if __name__ == '__main__':

0 commit comments

Comments
 (0)