-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShutdown Panel.py
More file actions
29 lines (21 loc) · 1.12 KB
/
Shutdown Panel.py
File metadata and controls
29 lines (21 loc) · 1.12 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
from tkinter import *
import os
def restart():
os.system("shutdown /r /t 1")
def restart_time():
os.system("shutdown /r /t 20")
def shutdown():
os.system("shutdown /s /t 1")
st = Tk() # Creating a Window
st.title("ShutDown Panel") # Giving a Title
st.geometry("500x500") # Dimensions
bg = PhotoImage(file = "Aditya_logo.png")
label = Label(st , image = bg)
label.place(x=0,y=0)
r_button = Button(st, text = "Restart", font = ("ROBOTO", 20, "bold"), relief = RAISED, cursor = "arrow", command=restart, bg="red2") # Creating Restart Button
r_button.place(x=150, y=100, height=50, width=200) # Height & Width
rt_button = Button(st, text = "Delay", font = ("ROBOTO", 20, "bold"), relief = RAISED, cursor = "plus", command=restart_time, bg="firebrick1") # Creating Restart Button
rt_button.place(x=150, y=225, height=50, width=200) # Height & Width
st_button = Button(st, text = "ShutDown", font = ("ROBOTO", 20, "bold"), relief = RAISED, cursor = "plus", command = shutdown, bg="orangered2") # Creating Restart Button
st_button.place(x=150, y=360, height=50, width=200) # Height & Width
st.mainloop()