From 5455621babbcedc0c82bf53e22a18fbfed2511af Mon Sep 17 00:00:00 2001 From: Dhanush Date: Mon, 3 Oct 2022 18:03:57 +0530 Subject: [PATCH 1/6] Create TakeABreak.py --- take_a_break/TakeABreak.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 take_a_break/TakeABreak.py diff --git a/take_a_break/TakeABreak.py b/take_a_break/TakeABreak.py new file mode 100644 index 000000000..a54cb5276 --- /dev/null +++ b/take_a_break/TakeABreak.py @@ -0,0 +1,9 @@ +import webbrowser +import time +total_breaks = 3 +break_count = 0 +print("This program started on"+time.ctime()) +while(break_count < total_breaks): + time.sleep(2*60*60) + webbrowser.open("http://www.youtube.com") + break_count+=1; From 4f6864f158a70a5464b645daf3060f8c9e1c8464 Mon Sep 17 00:00:00 2001 From: Dhanush Date: Mon, 3 Oct 2022 18:04:44 +0530 Subject: [PATCH 2/6] Update TakeABreak.py --- take_a_break/TakeABreak.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/take_a_break/TakeABreak.py b/take_a_break/TakeABreak.py index a54cb5276..3f784b465 100644 --- a/take_a_break/TakeABreak.py +++ b/take_a_break/TakeABreak.py @@ -1,8 +1,11 @@ import webbrowser import time + total_breaks = 3 break_count = 0 + print("This program started on"+time.ctime()) + while(break_count < total_breaks): time.sleep(2*60*60) webbrowser.open("http://www.youtube.com") From 11086275e76a0878d729c3e8313cdbb3a0f6f098 Mon Sep 17 00:00:00 2001 From: Dhanush Date: Mon, 3 Oct 2022 18:07:15 +0530 Subject: [PATCH 3/6] Create README.md --- take_a_break/README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 take_a_break/README.md diff --git a/take_a_break/README.md b/take_a_break/README.md new file mode 100644 index 000000000..be59d5e04 --- /dev/null +++ b/take_a_break/README.md @@ -0,0 +1,4 @@ +# Using take a break script + +### This program will take a break in your computer. +### For every two hours youtube.com will open in your browser for a period of 3 breaks From 701b063aed3ed50ada53e987649a71b48a0a565a Mon Sep 17 00:00:00 2001 From: Dhanush Date: Mon, 3 Oct 2022 18:23:04 +0530 Subject: [PATCH 4/6] Update TakeABreak.py --- take_a_break/TakeABreak.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/take_a_break/TakeABreak.py b/take_a_break/TakeABreak.py index 3f784b465..f81bc6a7e 100644 --- a/take_a_break/TakeABreak.py +++ b/take_a_break/TakeABreak.py @@ -1,12 +1,14 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- import webbrowser import time total_breaks = 3 break_count = 0 -print("This program started on"+time.ctime()) +print 'This program started on' + time.ctime() -while(break_count < total_breaks): - time.sleep(2*60*60) - webbrowser.open("http://www.youtube.com") - break_count+=1; +while break_count < total_breaks: + time.sleep(2 * 60 * 60) + webbrowser.open('http://www.youtube.com') + break_count += 1 From 3bb0e284b20825c5079fcdb1deb6fc3ecb0647fe Mon Sep 17 00:00:00 2001 From: Dhanush Date: Mon, 3 Oct 2022 18:24:46 +0530 Subject: [PATCH 5/6] Update TakeABreak.py --- take_a_break/TakeABreak.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/take_a_break/TakeABreak.py b/take_a_break/TakeABreak.py index f81bc6a7e..143047b7e 100644 --- a/take_a_break/TakeABreak.py +++ b/take_a_break/TakeABreak.py @@ -1,5 +1,3 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- import webbrowser import time From a4c5bd52c0f3e1c066ea94bb3c19d8ff7d150c07 Mon Sep 17 00:00:00 2001 From: Dhanush Date: Mon, 3 Oct 2022 18:33:10 +0530 Subject: [PATCH 6/6] Update TakeABreak.py --- take_a_break/TakeABreak.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/take_a_break/TakeABreak.py b/take_a_break/TakeABreak.py index 143047b7e..c8d0bfe24 100644 --- a/take_a_break/TakeABreak.py +++ b/take_a_break/TakeABreak.py @@ -1,12 +1,12 @@ import webbrowser import time -total_breaks = 3 -break_count = 0 +total_breaks = int(3) +break_count = int(0) -print 'This program started on' + time.ctime() +print("This program started on" + time.ctime()) while break_count < total_breaks: - time.sleep(2 * 60 * 60) - webbrowser.open('http://www.youtube.com') - break_count += 1 + time.sleep(int(2) * int(60) * int(60)) + webbrowser.open("http://www.youtube.com") + break_count += int(1)