2 Python Beginner Projects Tutorial in 15 minutes - Digital clock & Analog clock

preview_player
Показать описание
In this beginner python project tutorial we will be creating 2 complete Python projects using Python's GUI - Tkinter module!
While working through this beginner python project you can learn the basics and fundamentals of python and be able to apply those skills in your future python projects. If you're completely new to programming itself, please go through my Python learning playlist which is a complete list of short videos on learning Python from scratch:

If you're interested in this information in a course format, please let me know in the comments. I'm planning to release a complete Python course that will enable you to quickly get started with Python projects.

This python tutorial is designed to get you up and running in python as fast as possible.

- Beginner Python Project
- Python Project Tutorial
- Python Tutorial
- Python Beginner Projects
- Beginner Python Tutorial
- Analog clock python project tutorial
- Digital clock python project tutorial

This beginner python tutorial is divided into 2 sections:
Digital clock using Tkinter GUI module in Python:
In this section, we create a Tkinter GUI window and add a label text which represents the time. Using the time module of Python, we get the current time and update the Python label.

Analog clock using Tkinter GUI module in Python
In this section, we create a Tkinter GUI window and add an analog clock's image background. Then we will use Tkinter Canvas class to draw the image and lines in front of the image which will represent the seconds hand, minutes hand and hours hand of our analog python clock. Using the time module of Python, we get the current time and update the Python label. We'll update the position of the clock hands using the mathematical formula that is visually described in the video.

Code for both analog python clock(including the clock dial image) and the digital python clock can be found in my GitHub repo here:

Python project
Python beginner project
Python clock project
Python analog clock project
Python digital clock project

Animation library that I'm using is 3blue1brown's manim library.

It's a really cool library, so do check it out and also make sure to checkout 3blue1brown's YouTube channel as well where you can see the coolest implementations of the manim library:

Music used
Quiet Place by Jonny Easton
Check out his channel
Рекомендации по теме
Комментарии
Автор

Massivly underrated channel. Keep up the good work👍

therealrxyang
Автор

Excellent video man, you explained the math behind this really well. Cheers!

koimipoimi
Автор

Thank you, this works very well. I'd make one suggestion, though. The hour hand sticks only to the current hour and does not move naturally like a regular clock. To fix this, you can change the hours_x to be
"hours_x = hours_hand_len * math.sin(math.radians(hours *30 + 0.5 *minutes)) + center_x" and hours_y to
"hours_y = -1 * hours_hand_len * math.cos(math.radians(hours *30 + 0.5 *minutes)) + center_y". I use 0.5 because the hours hand must move 30 degrees in 60 minutes hence 30degrees / 60 min = 0.5 degrees every minute
This is how I did it however, I'm wondering if you could use seconds instead of minutes for an even more accurate representation.

MD-kbzt
Автор

Thanks a lot, this has really peaked my interest quite a bit, i am willing to learn this module.
this small project of yours really helped, keep up the good work

shreyask.p
Автор

The problem with analog clock is that the hour hand does not move when the minute hand moves. So it it is 4:30, the hour hand still pointing at 4 when it should point between 4 and 5.

jaguelo
Автор

This was explained very well, Thank you!

Tejasvanaparthy
Автор

I make digital clock ITS WORKED WELL
THANK YOU

greatthingstechno
Автор

Hello Bro thank you for video. All them work exlantly

technicalengineer
Автор

my needle is moving anti-clock wise what can be the fault ?

kaminirathi
Автор

thanks a lot bro
other videos never ran

veerpratapsingh
Автор

can we work with vscode instead pycharm

nalajalabhuvana
Автор

bro can you pls help the issue (error) AttributeError: module 'tkinter' has no attribute 'label'

PravinTalentKid
Автор

thanks that awesome video, but why the code isn't working
canvas.pack(expand=True, fill='both')

rethiszeno
Автор

How to convert the clock program to py to exe file and there is a problem like UPX is not available.while converting this py to exe file how to convert it py to exe in command prompt.

KarthikKarthik-lgye
Автор

I have the clock image saved on the desktop but it won't load says "cannot resolve file". No long valid, Here is the code I have: # create background
bg =
canvas.create_image(200., 200, image=bg). Any suggestions?

christopherchastain
Автор

When we converting to digital to analog thrn u r click on a dial_400.png u get clock image how should I create sir from where I should create that can u reply please

YamunaDharavath
Автор

I followed this step by step and the hands are not moving for me???

ryanmichelson
Автор

Bro how to save it and how to create a analog

krishchauhan
Автор

In a clock how we get microsecond counting

shahulhameedmohamedminsar
Автор

Please how did you put your multiplication sign

Flurryface_
welcome to shbcf.ru