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 :: timer pythongame 
Python :: delete a row in pandas dataframe 
Python :: print the number of times that the substring occurs in the given string 
Python :: how to convert png to pdf with python 
Python :: pandas dataframe column to datetime 
Python :: install python3 6 ubuntu 20 
Python :: remove last element from dictionary python 
Python :: how do i create a file in specific folder in python 
Python :: how to find index of second largest number in array python 
Python :: Violin Plots in Seaborn 
Python :: print fibonacci series in reverse in python 
Python :: python break when key pressed 
Python :: add font to the label in window tkinter 
Python :: count how many times a value shows in python list 
Python :: python count distinct letters 
Python :: linkedin dynamic scrolling using selenium python 
Python :: explode dictionary pandas 
Python :: python install bigquery 
Python :: python merge two dictionaries 
Python :: mode of a column in df 
Python :: get env variable linux python 
Python :: python write txt utf8 
Python :: python program to display the current date and time 
Python :: csv reader python skip header 
Python :: is prime in python 
Python :: boxplot label python 
Python :: psyche asteroid 
Python :: puissance python 
Python :: pandas drop column by name 
Python :: django get or 404 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =