Skip to content

Commit 9fb180b

Browse files
authored
Update README.md
1 parent 4e37433 commit 9fb180b

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,35 @@ The clock face more visually appealing, allow dynamic resizing, and add tick mar
77

88
- The code imports the 𝒕𝒌𝒊𝒏𝒕𝒆𝒓 module for creating GUI applications and the 𝒕𝒊𝒎𝒆 module for handling time-related operations.
99

10+
2️⃣ 𝐂𝐫𝐞𝐚𝐭𝐢𝐧𝐠 𝐭𝐡𝐞 𝐌𝐚𝐢𝐧 𝐖𝐢𝐧𝐝𝐨𝐰:
11+
12+
![codeimage-snippet_7](https://github.com/kaniz-codes/Analog-Clock-Python/assets/138873297/443bec1b-1484-4d6d-a54f-f0a253acc546)
13+
14+
- The code defines a custom class AdvancedAnalogClock that inherits from tk.Tk.
15+
- This class represents the main application window.
16+
17+
3️⃣ 𝐖𝐢𝐧𝐝𝐨𝐰 𝐑𝐞𝐬𝐢𝐳𝐚𝐛𝐢𝐥𝐢𝐭𝐲 𝐚𝐧𝐝 𝐌𝐢𝐧𝐢𝐦𝐮𝐦 𝐒𝐢𝐳𝐞:
18+
19+
![codeimage-snippet_7 (2)](https://github.com/kaniz-codes/Analog-Clock-Python/assets/138873297/7b274b5d-2ad9-4d42-81bf-3b9339012750)
20+
21+
- This code allows the window to be resized both horizontally and vertically (the first 𝐓𝐫𝐮𝐞 argument) and sets a minimum window size of 300 pixels in width and 100 pixels in height.
22+
23+
4️⃣ 𝐭𝐢𝐦𝐞_𝐮𝐩𝐝𝐚𝐭𝐞() 𝐅𝐮𝐧𝐜𝐭𝐢𝐨𝐧:
24+
25+
![codeimage-snippet_7 (3)](https://github.com/kaniz-codes/Analog-Clock-Python/assets/138873297/92ec5050-8a30-46d4-ad59-6b1648c620e9)
26+
27+
- 𝒕𝒊𝒎𝒆_𝒖𝒑𝒅𝒂𝒕𝒆 is a function defined to update the time and date displayed in the GUI.
28+
- It gets the current time and date using 𝒍𝒐𝒄𝒂𝒍𝒕𝒊𝒎𝒆() and formats them into strings using strftime().
29+
- The formatted time and date strings are then updated in labels (𝒕𝒊𝒎𝒆_𝒍𝒂𝒃𝒆𝒍 𝒂𝒏𝒅 𝒅𝒂𝒕𝒆_𝒍𝒂𝒃𝒆𝒍)).
30+
- Finally, the function schedules itself to run again after 1000 milliseconds (1 second) using 𝒓𝒐𝒐𝒕.𝒂𝒇𝒕𝒆𝒓(1000, 𝒕𝒊𝒎𝒆_𝒖𝒑𝒅𝒂𝒕𝒆
31+
, ensuring that the time is continuously updated.
32+
33+
5️⃣ 𝐂𝐫𝐞𝐚𝐭𝐢𝐧𝐠 𝐚 𝐅𝐫𝐚𝐦𝐞:
34+
35+
![codeimage-snippet_7 (4)](https://github.com/kaniz-codes/Analog-Clock-Python/assets/138873297/7007fb75-fa7a-4f58-a423-267b3820d6db)
36+
37+
- A frame is created to contain the labels (𝒕𝒊𝒎𝒆_𝒍𝒂𝒃𝒆𝒍 𝒂𝒏𝒅 𝒅𝒂𝒕𝒆_𝒍𝒂𝒃𝒆𝒍).
38+
- The frame has a black background with padding (padx and pady) to provide some spacing around the labels.
39+
40+
6️⃣ 𝐂𝐫𝐞𝐚𝐭𝐢𝐧𝐠 𝐋𝐚𝐛𝐞𝐥𝐬 𝐟𝐨𝐫 𝐓𝐢𝐦𝐞 𝐚𝐧𝐝 𝐃𝐚𝐭𝐞:
41+

0 commit comments

Comments
 (0)