-
Notifications
You must be signed in to change notification settings - Fork 0
/
trashfile.2.py
35 lines (24 loc) · 1 KB
/
trashfile.2.py
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
import tkinter as tk
import subprocess
def run_script():
# Replace "other_script.py" with the filename of the other Python script
subprocess.Popen(["python", "C:/Users/DELL/Desktop/PPS Code projects/Final project/Python Ultimate Student interface.py"])
root = tk.Tk()
# Create a button with text "Run Script" and bind it to the run_script function
ab=tk.Button(root,width=39,pady=7,text='Open Programs',bg='#23aaf2',fg='white',border=0,cursor='hand2',command=run_script)
ab.pack(padx=5,pady=10)
# Function to change button color on hover
def on_hover(event):
ab['background'] = '#1b86bf'
ab['foreground'] = 'white'
ab['font'] = 'Bahnschrift 9 underline'
# Function to change button color when not hovering
def off_hover(event):
ab['background'] = '#23aaf2'
ab['foreground'] = 'white'
ab['font'] = 'Bahnschrift 9'
# Bind hover events to button
ab.bind('<Enter>', on_hover)
ab.bind('<Leave>', off_hover)
# import_variable.py
root.mainloop()