[BangPypers] file handling

Anand Balachandran Pillai abpillai at gmail.com
Mon Jun 14 08:21:36 CEST 2010


On Mon, Jun 14, 2010 at 11:48 AM, madhuri vio <madhuri.vio at gmail.com> 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
>

Text file  ? Looks like a zip file to me (pkzip) with its "PK" signature.
Are you sure you are opening a text file here ?


>
> i am unable to proceed
> --
> madhuri :)
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>



-- 
--Anand


More information about the BangPypers mailing list