Python
2
Вклад в тег
import subprocess, os
path_py = input("Path to file.py: ")
mode = input("Hide the console window?(y/n): ")
path_ico = input("Path to icon: ")
if mode == "y":
mode = "-w "
else:
mode = ""
if not path_ico == "":
path_ico = "-i " + path_ico + " "
name = os.path.splitext(os.path.basename(path_py))
path_exe = os.path.abspath(os.curdir) + '\\dist\\' + name[0] + '.exe'
command = "pyinstaller -F " + mode + path_ico + path_py
print("\nCommand: ", command, "\n")
log_concole = subprocess.getoutput(command)
print("***********************************\n", log_concole, "\n***********************************\n\n", "Path to exe: ", path_exe)