简体   繁体   English

使用 pyinstaller 分发我的 TKinter 应用程序不起作用

[英]Distributing my TKinter app with pyinstaller doesn't work

I have an app with 2 classes: class called GUI, and a logic class being used by the GUI.我有一个包含 2 个类的应用程序:称为 GUI 的 class 和 GUI 使用的逻辑 class。 The GUI class app is being initiated by this 4 lines at the bottom of the class: GUI class 应用程序由 class 底部的这 4 行启动:

if __name__ == '__main__':
    global g
    g = gui()
    g.start()

But when I try to do the following command on cmd:但是当我尝试在 cmd 上执行以下命令时:

pyinstaller --onefile --noconsole --GUI.py

I get the following error:我收到以下错误:

pyinstaller: error: the following arguments are required: scriptname

What can I do?我能做些什么? I want to have the option to deploy the app to users, where they can just click and launch it after downloading a zip file with the project.我希望可以选择将应用程序部署给用户,他们可以在下载项目的 zip 文件后单击并启动它。 The project consists of 2 classes aforementioned, and an image.该项目由上述2个类和一个图像组成。

You should be able to just get rid of the two dashes in front of GUI.py, if that is the name of your python file.如果那是 python 文件的名称,您应该可以去掉 GUI.py 前面的两个破折号。 See here这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM