Digital Clock with Python : Learn to Code


DigitalClock.py

import tkinter as tk
from tkinter import Label
import time

# Create the main window
root = tk.Tk()
root.title("Digital Clock")

# Define the clock function
def clock():
    # Get the current time
    current_time = time.strftime("%H:%M:%S %p")
    # Update the label with the current time
    clock_label.config(text=current_time)
    # Call the clock function after 1000ms (1 second)
    clock_label.after(1000, clock)

# Create a label to display the time
clock_label = Label(root, font=('calibri', 40, 'bold'), background='purple', foreground='white')
clock_label.pack(anchor='center')

# Call the clock function to update the time
clock()

# Start the main loop
root.mainloop()


0
0
0.000
16 comments
avatar

This is a bit harder to understand for me, but I think I got it - or at least most of it 😅

Curated by @arc7icwolf.byte for the #LearnToCode community.

0
0
0.000
avatar

It's really just the import that does the heavy lifting here.

I'm still working on my first cluster. I have one slave functioning but have to set up since kinda dynamic network to get them to work together

0
0
0.000
avatar

Using modules and libraries is cool, but it's something that I found a bit difficult to do... I have to do more exercises and try to better undestand how to use some powerfull tools like tkinter.

0
0
0.000
avatar

Source

Hello.

There is reasonable evidence that this article is machine-generated.

We would appreciate it if you could avoid publishing AI-generated content (full or partial texts, art, etc.).

Thank you.

Guide: AI-Generated Content = Not Original Content

If you believe this comment is in error, please contact us in #appeals in Discord.

0
0
0.000
avatar

How is code AI generated? It's universal.

0
0
0.000
avatar

You did not write that function. You copied and pasted it.

0
0
0.000
avatar

Not true at all. Sorry you think so. I've actually taken classes and this is one of the things they teach.

0
0
0.000
avatar

Either way, it is plagiarism as the source was not mentioned.
If the source was mentioned, then it would be Copypasta with no original content.

0
0
0.000
avatar

If the code was written differently would it work?

The answer is no.

Is teaching someone to ride a bike, or fish, or even write, is that plagiarism?

You will do as you wish but you're incorrect here.

Enjoy the rest of your weekend.

0
0
0.000
avatar

FAKE HIVE POLICE

HIVE IS DEAD

HIVE IS ONE BIG FARM

!LOL !WEED !MEME !GIF

60 votes
slobberchops [-]
gogreenbuddy [-]
cmplxty [-]
shanibeer [-]
antisocialist [-]
azabu [-]
acram64 [-]
mypathtofire [-]
willowranger [-]
bscrypto [-]
dhedge [-]
aaronkroeblinger [-]
lichtkunstfoto [-]
memehub [-]
chekohler [-]
modernzorker [-]
carn [-]
earthsea [-]
pinkhub [-]
kaylinart [-]
and 40 more

https://hive.blog/hive-104387/@bpcvoter3/se19g2

Downvoted BY HIVE FARMERS

slobberchops (81)in #life • 6 days ago
The_commentphant.jpg

6 days ago in #life by slobberchops (81)$0.00
Reply 3
Sort: Trending
[-]bpcvoter2 (-5)(1) 4 days ago · Will be hidden due to low rating
NO DOWNVOTES FOR MARKY MARK'S SELF VOTING !WEED

https://hive.blog/life/@slobberchops/re-gogreenbuddy-sdr1wb

https://www.publish0x.com/the-dark-side-of-hive

https://www.reddit.com/r/stoptheabuseonhive/

https://peakd.com/hive-164833/@bilpcoinbpc/you-have-all-witnessed-this-account-being-downvoted-to-a-negative-reputation-for-no-reason

SHAME ON YOU ALL SAD PEOPLE WHO SCAM LIE AND FARM HIVE AND HIVERS

[-]acidyo (82) 3 months ago
Haha at "I shouldn't make commercial" :D Maybe something to worry about when you have more youtube subscribers! Quite interesting content though, these things should get more subs on there and here.

$4.28
1 vote
Reply
[-]gogreenbuddy (67) 3 months ago
Yeah thought that was funny too

$4.54
4 votes
gogreenbuddy: $4.47
acidyo: $0.06
holbein81: $0.01
koleso: -$0.00

https://hive.blog/life/@gogreenbuddy/i-had-to-give-up-on-my-gabion-fencing-too-much-work

@themarkymark @buildawhale @upmyvote @ipromote @gogreenbuddy @usainvote @punkteam @makerhacks @apeminingclub @leovoter @blockheadgamds @rollingbones farm @cwow2 @solominer @steevc @adm @abit @theycallmedan @dalz @abh12345

HE MAKES CURATION REWARDS WITH ALL HIS ALT ACCOUNTS BURNING TOKENS LIKE THIS DOES NOT TAKE OLD TOKENS IT MINTS NEW ONES AND BURNS THEM

https://hive.blog/hive-167922/@bilpcoinbpc/the-power

https://www.bilpcoin.com/hive-167922/@bilpcoinbpc/the-power

https://www.bilpcoin.com/hive-167922/@bpcvoter1/response-4-to-themarkymark-marcus-buildawhale-usainvote-ipomote-leovoter-gogreenbuddy-and-over-100-of-his-alt-accounts

0
0
0.000
avatar

FAKE HIVE POLICE

HIVE IS DEAD

HIVE IS ONE BIG FARM

!LOL !WEED !MEME !GIF

60 votes
slobberchops [-]
gogreenbuddy [-]
cmplxty [-]
shanibeer [-]
antisocialist [-]
azabu [-]
acram64 [-]
mypathtofire [-]
willowranger [-]
bscrypto [-]
dhedge [-]
aaronkroeblinger [-]
lichtkunstfoto [-]
memehub [-]
chekohler [-]
modernzorker [-]
carn [-]
earthsea [-]
pinkhub [-]
kaylinart [-]
and 40 more

https://hive.blog/hive-104387/@bpcvoter3/se19g2

Downvoted BY HIVE FARMERS

slobberchops (81)in #life • 6 days ago
The_commentphant.jpg

6 days ago in #life by slobberchops (81)$0.00
Reply 3
Sort: Trending
[-]bpcvoter2 (-5)(1) 4 days ago · Will be hidden due to low rating
NO DOWNVOTES FOR MARKY MARK'S SELF VOTING !WEED

https://hive.blog/life/@slobberchops/re-gogreenbuddy-sdr1wb

https://www.publish0x.com/the-dark-side-of-hive

https://www.reddit.com/r/stoptheabuseonhive/

https://peakd.com/hive-164833/@bilpcoinbpc/you-have-all-witnessed-this-account-being-downvoted-to-a-negative-reputation-for-no-reason

SHAME ON YOU ALL SAD PEOPLE WHO SCAM LIE AND FARM HIVE AND HIVERS

[-]acidyo (82) 3 months ago
Haha at "I shouldn't make commercial" :D Maybe something to worry about when you have more youtube subscribers! Quite interesting content though, these things should get more subs on there and here.

$4.28
1 vote
Reply
[-]gogreenbuddy (67) 3 months ago
Yeah thought that was funny too

$4.54
4 votes
gogreenbuddy: $4.47
acidyo: $0.06
holbein81: $0.01
koleso: -$0.00

https://hive.blog/life/@gogreenbuddy/i-had-to-give-up-on-my-gabion-fencing-too-much-work

@themarkymark @buildawhale @upmyvote @ipromote @gogreenbuddy @usainvote @punkteam @makerhacks @apeminingclub @leovoter @blockheadgamds @rollingbones farm @cwow2 @solominer @steevc @adm @abit @theycallmedan @dalz @abh12345

HE MAKES CURATION REWARDS WITH ALL HIS ALT ACCOUNTS BURNING TOKENS LIKE THIS DOES NOT TAKE OLD TOKENS IT MINTS NEW ONES AND BURNS THEM

https://hive.blog/hive-167922/@bilpcoinbpc/the-power

https://www.bilpcoin.com/hive-167922/@bilpcoinbpc/the-power

https://www.bilpcoin.com/hive-167922/@bpcvoter1/response-4-to-themarkymark-marcus-buildawhale-usainvote-ipomote-leovoter-gogreenbuddy-and-over-100-of-his-alt-accounts

0
0
0.000
avatar

Is there a way I can post fundamental learning code posts of basic code to not trigger a down vote?

0
0
0.000
avatar

FAKE HIVE POLICE

HIVE IS DEAD

HIVE IS ONE BIG FARM

!LOL !WEED !MEME !GIF

60 votes
slobberchops [-]
gogreenbuddy [-]
cmplxty [-]
shanibeer [-]
antisocialist [-]
azabu [-]
acram64 [-]
mypathtofire [-]
willowranger [-]
bscrypto [-]
dhedge [-]
aaronkroeblinger [-]
lichtkunstfoto [-]
memehub [-]
chekohler [-]
modernzorker [-]
carn [-]
earthsea [-]
pinkhub [-]
kaylinart [-]
and 40 more

https://hive.blog/hive-104387/@bpcvoter3/se19g2

Downvoted BY HIVE FARMERS

slobberchops (81)in #life • 6 days ago
The_commentphant.jpg

6 days ago in #life by slobberchops (81)$0.00
Reply 3
Sort: Trending
[-]bpcvoter2 (-5)(1) 4 days ago · Will be hidden due to low rating
NO DOWNVOTES FOR MARKY MARK'S SELF VOTING !WEED

https://hive.blog/life/@slobberchops/re-gogreenbuddy-sdr1wb

https://www.publish0x.com/the-dark-side-of-hive

https://www.reddit.com/r/stoptheabuseonhive/

https://peakd.com/hive-164833/@bilpcoinbpc/you-have-all-witnessed-this-account-being-downvoted-to-a-negative-reputation-for-no-reason

SHAME ON YOU ALL SAD PEOPLE WHO SCAM LIE AND FARM HIVE AND HIVERS

[-]acidyo (82) 3 months ago
Haha at "I shouldn't make commercial" :D Maybe something to worry about when you have more youtube subscribers! Quite interesting content though, these things should get more subs on there and here.

$4.28
1 vote
Reply
[-]gogreenbuddy (67) 3 months ago
Yeah thought that was funny too

$4.54
4 votes
gogreenbuddy: $4.47
acidyo: $0.06
holbein81: $0.01
koleso: -$0.00

https://hive.blog/life/@gogreenbuddy/i-had-to-give-up-on-my-gabion-fencing-too-much-work

@themarkymark @buildawhale @upmyvote @ipromote @gogreenbuddy @usainvote @punkteam @makerhacks @apeminingclub @leovoter @blockheadgamds @rollingbones farm @cwow2 @solominer @steevc @adm @abit @theycallmedan @dalz @abh12345

HE MAKES CURATION REWARDS WITH ALL HIS ALT ACCOUNTS BURNING TOKENS LIKE THIS DOES NOT TAKE OLD TOKENS IT MINTS NEW ONES AND BURNS THEM

https://hive.blog/hive-167922/@bilpcoinbpc/the-power

https://www.bilpcoin.com/hive-167922/@bilpcoinbpc/the-power

https://www.bilpcoin.com/hive-167922/@bpcvoter1/response-4-to-themarkymark-marcus-buildawhale-usainvote-ipomote-leovoter-gogreenbuddy-and-over-100-of-his-alt-accounts

0
0
0.000