problem compiling executable with py2exe

T

tim

I wrote this very simple program that checks a directory and makes a
list of files that surpass a given size.
I tried to compile it using py2exe.
I used py2exe before with more complex programs without any problem.
Now, although my program works fine when I run it from PythonWin, it
won't compile to an executable.

here's the program:

#############
import os

blacklist=[]
d=raw_input('path')
s=int(raw_input('maxsize (in bytes):'))
f = os.listdir(d)
outfile = open(d + r'\filelist_for_this_location.txt', 'wb')
outfile.write('files found in ' + d + '\n'+ 'checking maximum filesize:
' + str(s) + ' bytes...\n')
for n in f:
filepath = os.path.join(d,n)
if os.path.isfile(filepath):
outfile.write(n + '\n')
currsize = int(os.path.getsize(filepath))
if currsize >= s:
outfile.write('------------> is too big\n')
blacklist.append(filepath)
outfile.write('\n'+'\n'+ 'blacklist\n')
for bl in blacklist:
outfile.write(bl + '\n')
outfile.close()
##############

here's the py2exe error log:

Traceback (most recent call last):
File "filesizechecker.py", line 4, in ?
EOFError: EOF when reading a line

any idea?

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top