0

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?

agf
  • 171,228
  • 44
  • 289
  • 238
Synapse
  • 1,574
  • 6
  • 18
  • 19

1 Answers1

2

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.

Community
  • 1
  • 1
agf
  • 171,228
  • 44
  • 289
  • 238
  • no, it doesn't work. the cmd.exe simply starts the .exe then gives out another prompt. – Synapse Aug 09 '11 at 09:19
  • Did you use `py2exe`? If so, edit your post to add the contents of your `setup.py`. If not, edit it to say what you did use. I edited my answer, it may answer your question now if you did use `py2exe` but not the `console` argument. – agf Aug 09 '11 at 09:24