-
Notifications
You must be signed in to change notification settings - Fork 1
/
py_to_exe.py
31 lines (26 loc) · 911 Bytes
/
py_to_exe.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
import PySimpleGUI as sg
import os
#sg.ChangeLookAndFeel('GreenTan')
form = sg.FlexForm('', default_element_size=(30, 1))
layout = [ [sg.Text(' Python File Create EXE(.py) ',size=(25,1),font=("Helvetica", 20))],
[sg.Text('Input the Python File Name')],
[sg.Input('',key='py_file',size=(50,1)),
sg.FileBrowse('Browse',target='py_file',initial_folder=os.getcwd(),file_types=(("Python File","*.py"),))],
[sg.RButton('Create',size=(20,3))]
]
window = sg.Window('Pyinstall Py_To_EXE').Layout(layout)
while True:
button, value = window.read()
if button == None :
break
elif button=='Create':
command='pyinstaller -F -w '+value['py_file']
print(command)
f = os.popen(command, "r")
d = f.read() # 读文件
print(d)
f.close()
print('ok.....')
else:
pass
window.close()