简体   繁体   中英

How do I see “print”s from a python tkinter app converted to a .exe?

I built a tkinter app, then I converted it into a .exe . When I run the .exe , no console shows up.

But in the script, I wrote several print "stuff" statements, how can I display them when I run the .exe ?

Run the .exe from the console.

Easiest way to start the console is Start -> Run -> cmd.exe

Then cd to the directory where the .exe is, and run the .exe .

Edit: If you used py2exe , you may need to pass your script to setup() as the console argument:

setup(console=['hello.py'])

This will tell it you want console output. That's from the py2exe tutorial .

Also see Hiding console window of Python GUI app with py2exe , and do the opposite, since you don't want to hide the console output.

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