I want to do replacements in a utf-8 text file. example
f=open("test.txt","r") #this file is uft-8 encoded
raw = f.read()
txt = raw.decode("utf-8")
txt.replace{'English', ur'ഇംഗ്ലീഷ്') #replacing raw unicode string,
but not working
f.write(txt)
f.close()
f.flush()
please, help me
thanks
--
On Sep 27, 6:39 pm, "Mark Tolonen" wrote:
> "Junaid" wrote in message
>
> news:0267bef9-9548-4c43-bcdf-b624350c8...@p23g2000vbl.googlegroups.com...
>
> >I want to do replacements in a utf-8 text file. example
>
> > f=open("test.txt",&q
I was trying to parse a date string containing "EDT" time zone
eg: 'Mon Jun 20 14:00:57 EDT 2011'
I tried:
datetime.strptime('Mon Jun 20 14:00:57 EDT 2011', '%a %b %d %H:%M:%S %Z %Y')
But I get error
--
http://mail.python.org/mailman/listinfo/python-list
Thanks,
My script should be platform independent, so I think filtering out time zone
info is better.
--
http://mail.python.org/mailman/listinfo/python-list