Create Analog Clock using python | Build your own clock | beginner python project | world of python

Published: 10 August 2021
on channel: World of Python
561
24

Print("Hello Guys")🙋‍♂️
I am here to show how python works and in this video i am going to teach you how to make your own "Analog Clock" using python.

Follow me for more python related contents👨‍💻👨‍💻
___________________________________________________________________________________________________
My previous video :    • 🤩Iron man mask using python | How to draw ...  

USA flag using python :    • USA flag using python | How to draw USA Fl...  

Follow me🔻
Instagram : https://www.youtube.com/redirect?even...
________________________________________________________________________________________________

Source Code : from datetime import datetime
import matplotlib.pyplot as plt
import numpy as np
from numpy import pi
from matplotlib.animation import FuncAnimation
fig= plt.figure(figsize=(2.5,2.5),dpi=100)
ax = fig.add_subplot(111, polar=True)
def update(now):
plt.cla()
plt.setp(ax.get_yticklabels(), visible=False)
ax.set_xticks(np.linspace(0, 2*pi, 12, endpoint=False))
ax.set_xticklabels(range(1,13))
ax.set_theta_direction(-1)
ax.set_theta_offset(pi/3.0)
ax.grid(False)
plt.ylim(0,1)
now = datetime.now()
hour= now.hour
minute = now.minute
second = now.second
angles_h =2*pi*hour/12+2*pi*minute/(12*60)+2*second/(12*60*60)-pi/6.0
angles_m= 2*pi*minute/60+2*pi*second/(60*60)-pi/6.0
angles_s =2*pi*second/60-pi/6.0
ax.plot([angles_s,angles_s], [0,0.9], color="black", linewidth=1)
ax.plot([angles_m,angles_m], [0,0.7], color="black", linewidth=2)
ax.plot([angles_h,angles_h], [0,0.3], color="black", linewidth=4)
return ax
ani = FuncAnimation(fig,update, interval = 100)
plt.show()
________________________________________________________________________________________________
Song : Song: Fredji - Happy Life (Vlog No Copyright Music)
Music provided by Vlog No Copyright Music.
Video Link:    • Fredji - Happy Life (Vlog No Copyright Music)  


On this page of the site you can watch the video online Create Analog Clock using python | Build your own clock | beginner python project | world of python with a duration of hours minute second in good quality, which was uploaded by the user World of Python 10 August 2021, share the link with friends and acquaintances, this video has already been watched 561 times on youtube and it was liked by 24 viewers. Enjoy your viewing!