-
Notifications
You must be signed in to change notification settings - Fork 341
Expand file tree
/
Copy pathext.py
More file actions
29 lines (22 loc) · 669 Bytes
/
ext.py
File metadata and controls
29 lines (22 loc) · 669 Bytes
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 *
from tkinter import filedialog
import os
root = Tk()
root.title('Codemy.com')
root.iconbitmap('c:/gui/codemy.ico')
root.geometry("600x400")
def open_program():
my_program = filedialog.askopenfilename()
my_label.config(text=my_program)
# Open the program
os.system('"%s"' % my_program)
def open_notepad():
notepad = 'c:/Windows/system32/notepad.exe'
os.system('"%s"' % notepad)
my_button = Button(root, text="Open Program", command=open_program)
my_button.pack(pady=20)
my_button2 = Button(root, text="Open Notepad", command=open_notepad)
my_button2.pack(pady=20)
my_label = Label(root, text="")
my_label.pack(pady=20)
root.mainloop()