Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
7 views
2 pages
Clock Py
timer script
Uploaded by
fierypro125
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download
Save
Save clock.py For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
7 views
2 pages
Clock Py
timer script
Uploaded by
fierypro125
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save clock.py For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save clock.py For Later
You are on page 1
/ 2
Search
Fullscreen
import tkinter as tk
from tkinter import ttk
from datetime import datetime
# Function to calculate the progress for day, month, and year
def calculate_progress():
now = datetime.now()
# Progress for the day
start_of_day = datetime(now.year, now.month, now.day)
end_of_day = datetime(now.year, now.month, now.day, 23, 59, 59)
progress_day = (now - start_of_day).total_seconds() / (end_of_day -
start_of_day).total_seconds()
# Progress for the month
start_of_month = datetime(now.year, now.month, 1)
end_of_month = datetime(now.year, now.month + 1, 1) if now.month != 12 else
datetime(now.year + 1, 1, 1)
progress_month = (now - start_of_month).total_seconds() / (end_of_month -
start_of_month).total_seconds()
# Progress for the year
start_of_year = datetime(now.year, 1, 1)
end_of_year = datetime(now.year + 1, 1, 1)
progress_year = (now - start_of_year).total_seconds() / (end_of_year -
start_of_year).total_seconds()
return progress_day, progress_month, progress_year, now
# Function to update the progress bars and the date display
def update_progress():
progress_day, progress_month, progress_year, now = calculate_progress()
# Update the progress bars
day_progress['value'] = progress_day * 100
month_progress['value'] = progress_month * 100
year_progress['value'] = progress_year * 100
# Update the labels to show the current date
day_label.config(text=f"Day Progress: {now.day}/{now.month}/{now.year} -
{progress_day*100:.2f}%")
month_label.config(text=f"Month Progress: {now.month}/{now.year} -
{progress_month*100:.2f}%")
year_label.config(text=f"Year Progress: {now.year} - {progress_year*100:.2f}%")
# After a set interval, call this function again
root.after(1000, update_progress)
# Create the main window
root = tk.Tk()
root.title("Progress of Day, Month, and Year")
# Create labels for displaying progress
day_label = tk.Label(root, text="Day Progress")
day_label.pack(pady=10)
month_label = tk.Label(root, text="Month Progress")
month_label.pack(pady=10)
year_label = tk.Label(root, text="Year Progress")
year_label.pack(pady=10)
# Create the progress bars
day_progress = ttk.Progressbar(root, length=300, mode='determinate', maximum=100)
day_progress.pack(pady=10)
month_progress = ttk.Progressbar(root, length=300, mode='determinate', maximum=100)
month_progress.pack(pady=10)
year_progress = ttk.Progressbar(root, length=300, mode='determinate', maximum=100)
year_progress.pack(pady=10)
# Initial call to update progress
update_progress()
# Start the Tkinter event loop
root.mainloop()
You might also like
Computer Science Investigatory Project Class 12
PDF
No ratings yet
Computer Science Investigatory Project Class 12
14 pages
Indicator Premium SUPER Scalping Killer Algo For TradingView
PDF
No ratings yet
Indicator Premium SUPER Scalping Killer Algo For TradingView
36 pages
Script Manager - Lua
PDF
No ratings yet
Script Manager - Lua
18 pages
Chin Leo
PDF
No ratings yet
Chin Leo
72 pages
Fixed Geotechnical Report App
PDF
No ratings yet
Fixed Geotechnical Report App
56 pages
Data Structure
PDF
No ratings yet
Data Structure
54 pages
How To Create A Simple Calculator Using Python - PDF 1234
PDF
No ratings yet
How To Create A Simple Calculator Using Python - PDF 1234
18 pages
Main Code
PDF
No ratings yet
Main Code
34 pages
Python Tkinter Gui Projects - Removed
PDF
No ratings yet
Python Tkinter Gui Projects - Removed
208 pages
Source Code
PDF
No ratings yet
Source Code
46 pages
GUI Eg
PDF
No ratings yet
GUI Eg
31 pages
Python Slip 1-10
PDF
No ratings yet
Python Slip 1-10
19 pages
Premium SUPER Scalping Killer Algo
PDF
No ratings yet
Premium SUPER Scalping Killer Algo
35 pages
DigitalDiary Code Reviewed
PDF
No ratings yet
DigitalDiary Code Reviewed
18 pages
Python Slips
PDF
No ratings yet
Python Slips
43 pages
Python Assignment Report1
PDF
No ratings yet
Python Assignment Report1
19 pages
Project Report
PDF
No ratings yet
Project Report
24 pages
GUI Eg f7b91d4f 3c1b 4242 Adb8 Fa2dbddde969
PDF
No ratings yet
GUI Eg f7b91d4f 3c1b 4242 Adb8 Fa2dbddde969
10 pages
1
PDF
No ratings yet
1
10 pages
PWP Project
PDF
No ratings yet
PWP Project
12 pages
Python Intenship
PDF
No ratings yet
Python Intenship
34 pages
Project Report
PDF
No ratings yet
Project Report
31 pages
Import tkinter-WPS Office
PDF
No ratings yet
Import tkinter-WPS Office
7 pages
Gannt Chart Python Code
PDF
No ratings yet
Gannt Chart Python Code
6 pages
Python Mini Project
PDF
No ratings yet
Python Mini Project
11 pages
Script Manghhhager - Lua
PDF
No ratings yet
Script Manghhhager - Lua
18 pages
Python Program Ms Word
PDF
No ratings yet
Python Program Ms Word
6 pages
PP Project - Docs
PDF
No ratings yet
PP Project - Docs
15 pages
Sodapdf
PDF
No ratings yet
Sodapdf
5 pages
1c Replace
PDF
No ratings yet
1c Replace
7 pages
Canada NOC Code List PDF 2024 - In-Demand Jobs in Canada
PDF
No ratings yet
Canada NOC Code List PDF 2024 - In-Demand Jobs in Canada
363 pages
Project File
PDF
No ratings yet
Project File
18 pages
Import Tkinter As TK
PDF
No ratings yet
Import Tkinter As TK
10 pages
Python HandsOn-Function&OOPs
PDF
77% (93)
Python HandsOn-Function&OOPs
16 pages
Import Tkinter As TK Time
PDF
No ratings yet
Import Tkinter As TK Time
4 pages
OOP in GUI
PDF
No ratings yet
OOP in GUI
9 pages
Accurate TianGanDiZhi Calendar Code
PDF
No ratings yet
Accurate TianGanDiZhi Calendar Code
2 pages
Source Code
PDF
No ratings yet
Source Code
8 pages
Experiment 12 YP
PDF
No ratings yet
Experiment 12 YP
6 pages
New 1
PDF
No ratings yet
New 1
2 pages
Pyhon Code
PDF
No ratings yet
Pyhon Code
2 pages
Python Hands-On
PDF
No ratings yet
Python Hands-On
2 pages
Pomodoro Timer Python Code Research
PDF
No ratings yet
Pomodoro Timer Python Code Research
2 pages
Imd Python Code
PDF
No ratings yet
Imd Python Code
2 pages
Log Files
PDF
No ratings yet
Log Files
1 page
Teachnook MINOR PROJECT - PY
PDF
No ratings yet
Teachnook MINOR PROJECT - PY
9 pages
MODEL1
PDF
No ratings yet
MODEL1
14 pages
Calculator Python
PDF
No ratings yet
Calculator Python
2 pages
Calendar Python
PDF
No ratings yet
Calendar Python
1 page
Ab Initio Job Interview Questions and Answers
PDF
No ratings yet
Ab Initio Job Interview Questions and Answers
8 pages
Comboo
PDF
No ratings yet
Comboo
2 pages
HF Security Smart-Pass - Installation Instructions - 1.5.9 - 20220304
PDF
No ratings yet
HF Security Smart-Pass - Installation Instructions - 1.5.9 - 20220304
28 pages
Python Code For Setting Goals
PDF
No ratings yet
Python Code For Setting Goals
2 pages
Calculator
PDF
No ratings yet
Calculator
3 pages
3 Regression Diagnostics
PDF
100% (1)
3 Regression Diagnostics
53 pages
Ghant Chart
PDF
No ratings yet
Ghant Chart
11 pages
JHGJHGSDGSDGJHGJHG QFQFQFQF Dfljsdgsdglkasdl Asfasf Wegsdgsdgsdfg SDGSDGSDG
PDF
No ratings yet
JHGJHGSDGSDGJHGJHG QFQFQFQF Dfljsdgsdglkasdl Asfasf Wegsdgsdgsdfg SDGSDGSDG
2 pages
Types of 3D Printers - Complete Guide - SLA, DLP, FDM, SLS, SLM, EBM, LOM, BJ, MJ Printing
PDF
100% (2)
Types of 3D Printers - Complete Guide - SLA, DLP, FDM, SLS, SLM, EBM, LOM, BJ, MJ Printing
12 pages
Libre Office Writer MCQ
PDF
No ratings yet
Libre Office Writer MCQ
13 pages
314325-Electrical Estimating and Contracting
PDF
No ratings yet
314325-Electrical Estimating and Contracting
9 pages
Python Oops
PDF
No ratings yet
Python Oops
10 pages
Testbank and Solutions For Microelectronic Circuits 7th Edition
PDF
No ratings yet
Testbank and Solutions For Microelectronic Circuits 7th Edition
18 pages
Gui Calculator
PDF
No ratings yet
Gui Calculator
2 pages
Pivot Point OK
PDF
No ratings yet
Pivot Point OK
6 pages
Shell Model Ebook v4
PDF
No ratings yet
Shell Model Ebook v4
9 pages
1.9.4 Test (TST) - Foundations of Geometry (Test)
PDF
No ratings yet
1.9.4 Test (TST) - Foundations of Geometry (Test)
11 pages
MECHANICAL PADS - CIVIL - Construction - Division 23
PDF
No ratings yet
MECHANICAL PADS - CIVIL - Construction - Division 23
23 pages
Purchase Order Management
PDF
No ratings yet
Purchase Order Management
51 pages
Huawei Flash Storage
PDF
No ratings yet
Huawei Flash Storage
97 pages
Open MPLecture
PDF
No ratings yet
Open MPLecture
54 pages
DX Diag
PDF
No ratings yet
DX Diag
31 pages
Env SPV DR B 001 QC Manual Rev.A
PDF
No ratings yet
Env SPV DR B 001 QC Manual Rev.A
92 pages
Bhagyanagar Gas Limited: Bid Document For
PDF
No ratings yet
Bhagyanagar Gas Limited: Bid Document For
127 pages
Introduction To Computer L1-L3
PDF
No ratings yet
Introduction To Computer L1-L3
66 pages
Mivec Fault
PDF
No ratings yet
Mivec Fault
1 page
Unit 4 Deadlocks
PDF
No ratings yet
Unit 4 Deadlocks
20 pages
Lab 2
PDF
No ratings yet
Lab 2
14 pages
MD-100 Exam Study Guide
PDF
No ratings yet
MD-100 Exam Study Guide
6 pages
Sadhana
PDF
No ratings yet
Sadhana
2 pages
Vuex en
PDF
No ratings yet
Vuex en
42 pages
Pleiades Panharpening and Orthorectification
PDF
No ratings yet
Pleiades Panharpening and Orthorectification
10 pages
1588V2/Ptpv2 Synchronization of Alu Nodeb 1588 Design in Ip/Mpls Network
PDF
No ratings yet
1588V2/Ptpv2 Synchronization of Alu Nodeb 1588 Design in Ip/Mpls Network
12 pages
Root Insurance: Car Insurance Based On How People Drive, Not Who They Are
PDF
No ratings yet
Root Insurance: Car Insurance Based On How People Drive, Not Who They Are
4 pages
ANSWER SHEET IN Statisctics and Probabilty: Written Work
PDF
No ratings yet
ANSWER SHEET IN Statisctics and Probabilty: Written Work
1 page
Marantz RC 2001 Service Manual
PDF
No ratings yet
Marantz RC 2001 Service Manual
2 pages
Remote Projects Follow-up with Scrum-Excel Burn Down Chart: Scrum and Jira, #1
From Everand
Remote Projects Follow-up with Scrum-Excel Burn Down Chart: Scrum and Jira, #1
Quantic Statistics
No ratings yet
Introduction to PHP, Part 3, Second Edition
From Everand
Introduction to PHP, Part 3, Second Edition
Adam Majczak
No ratings yet
Profound Python Libraries
From Everand
Profound Python Libraries
Onder Teker
No ratings yet
Profound Python Data Science
From Everand
Profound Python Data Science
Onder Teker
No ratings yet