problem compiling executable with py2exe

Discussion in 'Python' started by tim, Nov 25, 2005.

  1. tim

    tim Guest

    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
     
    tim, Nov 25, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fredrik Lundh
    Replies:
    0
    Views:
    372
    Fredrik Lundh
    Nov 25, 2005
  2. Replies:
    15
    Views:
    502
    Dave Thompson
    Aug 21, 2006
  3. pratap
    Replies:
    20
    Views:
    779
    Flash Gordon
    Mar 7, 2007
  4. Jason Cavett
    Replies:
    8
    Views:
    640
    Sanjay
    May 16, 2007
  5. Replies:
    0
    Views:
    454
Loading...

Share This Page