用户:
yizigezi来自PowerAtom查看:0 回复:0 评论:0 创建时间:2021-08-25T12:42:38
import os
deMode = True
command = "pyinstaller"
def debugMode(val):
if deMode:
print(val)
print("1.文件路径")
fileDir = input("请输入要封装的代码文件路径\n(工具与文件在同一目录可直接填写文件名):")
debugMode(fileDir)
def parameterSet():
global parameter, com
print("2.参数设定(Y(启用)/n(不启用))")
print()
pa_1 = input("1) 无命令行窗口")
if pa_1 == "Y":
com = command + " -w "
else:
com = command
pa_2 = input("2) 封装为单个文件")
if pa_2 == "Y":
com = com + " -F "
com = com + fileDir
debugMode(com)
parameterSet()
y_n = input("确认开始封装?(Y/n)")
if y_n == "Y":
print("Start build")
os.system(com)
print("构建完成。")
else:
print("cancel build")