poweroffer/main.py

43 lines
1.2 KiB
Python
Raw Normal View History

2022-07-29 10:36:41 +02:00
#Libraries for create a window
2022-07-21 14:04:23 +02:00
import tkinter as tk
2022-07-29 10:36:41 +02:00
#Libraries for execute command
2022-07-21 14:04:23 +02:00
import subprocess
2022-07-29 10:47:05 +02:00
#Libraries for read web browser history
from browser_history.browsers import Firefox
#Print all browser history on txt
with open('history.txt', 'w') as f:
fi = Firefox()
outputs = fi.fetch_history()
his = outputs.histories
for line in his:
f.write(str(line))
f.write('\n')
2022-07-21 14:04:23 +02:00
window = tk.Tk()
2022-07-29 10:36:41 +02:00
#Resolution program
2022-07-21 14:04:23 +02:00
window.geometry("800x500")
2022-07-29 10:36:41 +02:00
#Title program
window.title("Poweroffer")
#Background program
2022-07-21 14:04:23 +02:00
window.configure(background="blue")
window.grid_columnconfigure(0, weight=1)
scritta = tk.Label(window, text="Welcome!", font=("Helvetica",15))
scritta.grid(row=0, column=0, sticky="N", padx=20, pady=10)
sito = tk.StringVar
text_input= tk.Entry(textvariable=sito)
text_input.grid(row=3, column=0, sticky="WE", padx=10, pady=10)
2022-07-29 10:36:41 +02:00
#Button stop procrastinating
2022-07-21 14:04:23 +02:00
second_button= tk.Button(text="Stop procrastinating", command=smetti)
second_button.grid(row=5, column=0, sticky="WE", padx=15, pady=8)
2022-07-29 10:36:41 +02:00
#Button for shutdown pc
2022-07-21 14:04:23 +02:00
first_button = tk.Button(text="have a break from the pc", command=spegni)
first_button.grid(row=1, column=0, sticky="W", padx=50, pady=50)
2022-07-29 10:36:41 +02:00
#Always open window
2022-07-21 14:04:23 +02:00
if __name__ == "__main__":
2022-07-29 10:36:41 +02:00
window.mainloop()