-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshutdownapp_using_python.py
More file actions
34 lines (27 loc) · 1.09 KB
/
shutdownapp_using_python.py
File metadata and controls
34 lines (27 loc) · 1.09 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
from tkinter import *
import os
def Restart():
os.system("shutdown /r /t 1")
def RestartTime():
os.system("shutdown /r /t 20")
def LogOut():
os.system("shutdown -l")
def Shutdown():
os.system("shutdown /s /t 1")
st = Tk()
st.title("Shutdown App")
st.geometry("500x500")
st.config(bg="blue")
r_button = Button(st,text="Restart",font=("Times New Roman",20,"bold"),
relief=RAISED,cursor="plus",command=Restart)
r_button.place(x=150,y=60,height=50,width=200)
rt_button = Button(st,text="Restart Time",font=("Times New Roman",20,"bold"),
relief=RAISED,cursor="plus",command=RestartTime)
rt_button.place(x=150,y=170,height=50,width=200)
lg_button = Button(st,text="Log Out",font=("Times New Roman",20,"bold"),
relief=RAISED,cursor="plus",command=LogOut)
lg_button.place(x=150,y=270,height=50,width=200)
st_button = Button(st,text="Shutdown",font=("Times New Roman",20,"bold"),
relief=RAISED,cursor="plus",command=Shutdown)
st_button.place(x=150,y=370,height=50,width=200)
st.mainloop()