File Reading In Mac

dilip raghavan dilip1984me at gmail.com
Mon Nov 22 20:26:00 EST 2010


Hello ,
         I have been trying to read contents from a file in MAC.
I wrote the code

filename = "test.rtf"
FileHandle = open(filename,'r')

fileStr = FileHandle.read()
print fileStr
FileHandle.close()

When I see the output I see a lot of junk. The junk is like a lot of
question marks, the font information and other details of the file.
The actual content is lost in the junk.

I have tried other methods like readline but still I see the junk.
I tried the asme code in windows and it worked correctly.
Can any one tell me the reason and the solution  for this.

Thanks In advance.



More information about the Python-list mailing list