Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

clock in python

# Here is a self updating clock function, just run it and it'll self update itself until you hit CTRL-C
import datetime
import time
def clock():
    while True:
        print(datetime.datetime.now().strftime("%H:%M:%S"), end="
")
        time.sleep(1)

clock()
Comment

how to make a clock in python 3

import sys
from  tkinter import *
import time 

def times():
    current_time=time.strftime("%H:%M:%S") 
    clock.config(text=current_time)
    clock.after(200,times)


root=Tk()
root.geometry("500x250")
clock=Label(root,font=("times",50,"bold"),bg="black",fg='blue')
clock.grid(row=2,column=2,pady=25,padx=100)
times()

digi=Label(root,text="Digital clock",font="times 24 bold",fg="violet")
digi.grid(row=0,column=2)

nota=Label(root,text="hours   minutes   seconds   ",font="times 15 bold")
nota.grid(row=3,column=2)

root.mainloop()

Comment

PREVIOUS NEXT
Code Example
Python :: create panda dataframe 
Python :: count occurrences of character in string python using dictionary 
Python :: Setting up Colab for Kaggle Downloads 
Python :: blender python add collection to scean collection 
Python :: how to calculate fibonacci numbers in python 
Python :: generate random int python 
Python :: pytohn reset all dictionary values to 0 
Python :: read list from txt python 
Python :: django get latest object 
Python :: user information in python 
Python :: how to use query_params in get_object djangorestframework 
Python :: delete rows in a table that are present in another table pandas 
Python :: python string cut last character 
Python :: python turtle set screen size 
Python :: fetch row where column is missing pandas 
Python :: tkinter text editor 
Python :: numpy.random.choice 
Python :: file uploads django 
Python :: django queryset limit 
Python :: python repet x time 
Python :: Simple Splash screen in pyqt5 
Python :: render() in django 
Python :: days to int 
Python :: create a django project 
Python :: xls in python 
Python :: how to import and use keyboard with pygame 
Python :: random.choices in python 
Python :: plt.hist using bins 
Python :: django create superuser from script 
Python :: python community 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =