-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDigital clock.py
More file actions
76 lines (55 loc) · 2.1 KB
/
Digital clock.py
File metadata and controls
76 lines (55 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import tkinter
from time import strftime
Timex = tkinter.Tk() #root
Timex.title("Digital Clock")
set_window = tkinter.Label(Timex, font=("DS-Digital", 100), #label
background="black", foreground="cyan")
set_window.pack(anchor="center")
def time():
patt = strftime("%I:%M:%S %p")
set_window.config(text=patt)
set_window.after(1000, time)
time()
tkinter.mainloop()
# #to get email's list from a huge data----------------------------------------------
# # email = re.findall(r"[0-9a-zA-Z._+%]+@[0-9a-zA-Z._+%]+[.][a-zA-Z.0-9]+", str)
# # email = re.findall(r"[a-zA-Z0-9_.-]+@[a-zA-Z0-9_.-]+\.[a-zA-Z]+",str)
# print(re.findall(r'\w+@\S+\w',str))
# #dice simulator---------------------------------------------------------
# from tkinter import Tk, Label, Button
# from random import choice
# root = Tk()
# root.title("Role Dice")
# root.geometry("500x500")
# label = Label(root, font=("helvetica", 250, "bold"))
# def rolldice():
# dice = ["\u2680", "\u2681", "\u2682", "\u2683", "\u2684", "\u2685"]
# label.config(text=choice(dice))
# label.pack() #we also can pack it outside of the function
# button = Button(root, font=("helvatica", 20, "bold"),
# text="click here", command=rolldice)
# button.pack()
# root.mainloop()
# check a number is perfect or not-------------------------------------------
# x= int(input("enter the number :"))
# sum=0
# for i in range(1,x):
# if x%i==0:
# sum+=i
# if sum==x:
# print(x," is a perfect number.")
# else:
# print(x," is not a perfect number.")
# # fulfilment messege on whatsapp----------------------------------------------
# import pywhatkit as kit
# import datetime
# # Phone number (include country code without '+')
# phone_number = "+918240248311"
# # Message to send
# message = "Hello from Python!"
# # Get the current time
# now = datetime.datetime.now()
# # Specify the time to send the message (hour, minute)
# send_time = (now.hour, now.minute + 1) # Send after 1 minute from current time
# # Send the message
# kit.sendwhatmsg(phone_number, message, send_time[0], send_time[1])