On Mon, Jun 14, 2010 at 2:48 AM, Supreet Sethi <supreet.se...@gmail.com> wrote: > On Mon, 2010-06-14 at 11:48 +0530, madhuri vio wrote: >> a = open("human","rb") >> print a.readlines() >> >> this is the code i have >> written to read a text file but i am unable to .. >> i get a very weird output... >> "PK\x03\x04\x14\x00\x00\x00\x00\x00\xd6+\xce<^\xc62\x0c'\x00\x00\x00'\x00\x00\x00\x08\x00\x00\x00mimetypeapplication/vnd.oasis.opendocument.textPK\x03\x04\x14\x00\x00\x00\x00\x00\xd6+\xce<\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00Configurations2/statusbar/PK\x03\x04\x14\x00\x08\x00\x08\x00\xd6+\xce<\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\x00\x00\x00Configurations2/accelerator/current.xml\x03\x00PK\x07\x08\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00PK\x03\x04\x14\x00\x00\x00\x00\x00\xd6+\xce<\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00Configurations2/floater/PK\x03\x04\x14\x00\x00\x00\x00\x00\xd6+\xce<\x00\x00\x00\x00\x00 > > You could try open via this sequence >>> import zipfile >>> z = zipfile.ZipFile("<filename here>") >>> z.infolist() > > See if it helps
Actually, this looks like a word processing document (ODT). Note the embedded mimetype "application/vnd.oasis.opendocument.text". Try using this library: http://odfpy.forge.osor.eu/ -srid _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers