Reputation: 113
Below is a simple file rename program that runs and works great, when launching from Python. Whenever I try compiling this program into a single .exe it won't launch and gives this error: File "UserInputRenameReplace.py", line 12, in EOFError: EOF when reading line.
What could this error mean, and why does it run fine in Python but not Py2exe?
import os
path = os.getcwd() #Working/active directory
filenames = os.listdir(path)
print "**Rename Active Directory File(s)**\n"
cur_Name = raw_input("Current Name: ")
new_Name = raw_input("New Name: ")
for filename in filenames:
os.rename(os.path.join(path, filename), os.path.join(path, filename.replace(cur_Name, new_Name)))
Upvotes: 1
Views: 195
Reputation: 13779
In your setup.py
make sure you are specifying console=['myscript.py']
and not windows=['myscript.py']
. The "EOF when reading line" error can result from stdin
being closed.
Upvotes: 1