how to read all bytes of a file in a list?

Benjamin phncontact.libero.it at
Mon Dec 16 12:45:59 EST 2002


hi

i have a file, and wrote a little program which should load every
single byte of the file into a list.

file_location = raw_input("file path > ")

list = []

input = open(file_location,"r")
s = input.read()
s = str(s)
print s
input.close()

print list


well, i just don't get it. i tried also some other versions, but none
worked. what am i doing wrong?

thanks in advance



More information about the Python-list mailing list