[Tutor] Decode and Encode

2015-01-28 Thread Sunil Tech
Hi All, When i copied a text from web and pasted in the python-terminal, it automatically coverted into unicode(i suppose) can anyone tell me how it does? Eg: >>> p = "你好" >>> p '\xe4\xbd\xa0\xe5\xa5\xbd' >>> o = 'ªîV' >>> o '\xc2\xaa\xc3\xaeV' >>> ___

Re: [Tutor] Using if statement with csv file

2015-01-28 Thread dw
Hi Tammy, I wonder how big your csv file is? I have ever read a small csv file into one variable. Even a csv file with 100 rows. And then split it into identified fields from there. I look at the csv file with Notepad++ to see if the data rows end with a \r or a \n. I then split that into a list an

Re: [Tutor] Decode and Encode

2015-01-28 Thread Chris Warrick
On Wed, Jan 28, 2015 at 10:35 AM, Sunil Tech wrote: > Hi All, > > When i copied a text from web and pasted in the python-terminal, it > automatically coverted into unicode(i suppose) > > can anyone tell me how it does? > Eg: p = "你好" p > '\xe4\xbd\xa0\xe5\xa5\xbd' o = 'ªîV' o >

Re: [Tutor] Using if statement with csv file

2015-01-28 Thread Alan Gauld
On 27/01/15 22:40, dw wrote: I have ever read a small csv file into one variable. Even a csv file with 100 rows. And then split it into identified fields from there. I look at the csv file with Notepad++ to see if the data rows end with a \r or a \n. I then split that into a list and each row is

Re: [Tutor] Decode and Encode

2015-01-28 Thread Steven D'Aprano
On Wed, Jan 28, 2015 at 03:05:58PM +0530, Sunil Tech wrote: > Hi All, > > When i copied a text from web and pasted in the python-terminal, it > automatically coverted into unicode(i suppose) > > can anyone tell me how it does? > Eg: > >>> p = "你好" > >>> p > '\xe4\xbd\xa0\xe5\xa5\xbd' It is hard

Re: [Tutor] Using if statement with csv file

2015-01-28 Thread Mark Lawrence
On 27/01/2015 22:40, dw wrote: Hi Tammy, I wonder how big your csv file is? I have ever read a small csv file into one variable. Even a csv file with 100 rows. And then split it into identified fields from there. I look at the csv file with Notepad++ to see if the data rows end with a \r or a \n.

Re: [Tutor] Decode and Encode

2015-01-28 Thread Sunil Tech
Thank you for all your replies​​ On Wed, Jan 28, 2015 at 4:56 PM, Steven D'Aprano wrote: > On Wed, Jan 28, 2015 at 03:05:58PM +0530, Sunil Tech wrote: > > Hi All, > > > > When i copied a text from web and pasted in the python-terminal, it > > automatically coverted into unicode(i suppose) > > >