简体   繁体   中英

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. The GUI class app is being initiated by this 4 lines at the bottom of the class:

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

But when I try to do the following command on 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. The project consists of 2 classes aforementioned, and an image.

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. See here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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