0

Sorry for the confusing question. I am working on a GUI and backend of a program that takes information from the gmail-api makes it into a text file. The back end and GUI(Tkinter) are working perfectly but through the python3 shell. When I just click on the python script within the directory a black command prompt appears and then disappears.

When I click on a prototype I have of the GUI that does not call another script but a text file, the GUI pops up perfectly. This is after I used pyinstaller to make it an executable.

My end goal is to make the whole GUI and back end an executable file.

I was wondering if anyone knows why this happens. I think it might be because of it having to call another script...but I am not sure.

Sorry again for the confusing question and wordy explanation.

1 Answer 1

1

You want to go to the terminal after you've intalled pyinstaller and run this command:

pyinstaller --onefile --noconsole yourtkinter.py

Explanation:

--onefile : Optional here, more comfortable for tiny tkinter projects.

--noconsole : Will solve your command line opening issue.

Find here more about the pyinstaller package: https://pyinstaller.readthedocs.io/en/stable/usage.html

Sign up to request clarification or add additional context in comments.

12 Comments

so if the other script the gui calls is in the same file as the .exe it should work?
You mean the text file you fill from Gmail API scraping? Yes, I would put every important "dependent" file in the same directory and call it from here. Of course always keep the exe and the dependency files in the same folder
more, the other script the gui calls the main() of
This is how you want to import everything: from .importantfileone import * , from .importantfiletwo import * , from .importantfilethree import *
ok, so with the "." before the name of the script being called? sorry for all the quesitons
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.