[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Py2EXE Error Involving raw_input





On 10/13/07, kschnee@xxxxxxxxxx <kschnee@xxxxxxxxxx> wrote:
I tried to build the little graphics tool I recently mentioned -- the one
that makes "edge tiles" -- into an EXE, and got a strange error. The
program runs fine in IDLE and when run directly by double-clicking the
source file, but the EXE crashes with the following error (automatically
placed in a logfile):

Traceback (most recent call last):
  File "tile_maker.py", line 98, in ?
  File "tile_maker.py", line 90, in RunDemo
EOFError: EOF when reading a line

Where the relevant line is just this:

    tile1 = raw_input("Image 1 filename (BMP/PNG in same directory)?> ")

In other words the raw_input command is doing something odd in EXE form,
even before the program is able to display the prompt or accept input. Any
idea what's going on, or why this error would only appear in the EXE? This
is a very simple program with no special modules but Pygame.


My guess is that you used py2exe with the "windows" argument, meaning that no console is opened - without a console there is no stdin for raw_input to use.  You can instead use the "console" argument in your setup.py, and your exe will open a console window allowing raw_input to work.