how to transfer my utf8 code saved in a file to gbk code

2009-06-07 Thread higer
My file contains such strings : \xe6\x97\xa5\xe6\x9c\x9f\xef\xbc\x9a I want to read the content of this file and transfer it to the corresponding gbk code,a kind of Chinese character encode style. Everytime I was trying to transfer, it will output the same thing no matter which method was used. I

Re: how to transfer my utf8 code saved in a file to gbk code

2009-06-07 Thread higer
On Jun 7, 11:25 pm, John Machin wrote: > On Jun 7, 10:55 pm, higer wrote: > > > My file contains such strings : > > \xe6\x97\xa5\xe6\x9c\x9f\xef\xbc\x9a > > Are you sure? Does that occupy 9 bytes in your file or 36 bytes? > It was saved in a file, so it occup

Re: how to transfer my utf8 code saved in a file to gbk code

2009-06-07 Thread higer
On Jun 8, 8:20 am, MRAB wrote: > John Machin wrote: > > On Jun 8, 12:13 am, "R. David Murray" wrote: > >> higer wrote: > >>> My file contains such strings : > >>> \xe6\x97\xa5\xe6\x9c\x9f\xef\xbc\x9a > >> If those bytes are what is

Re: how to transfer my utf8 code saved in a file to gbk code

2009-06-08 Thread higer
Thank you Mark, that works. Firstly using 'string-escape' to decode the content is the key point,so I can get the Chinese characters now. Regards, -higer -- http://mail.python.org/mailman/listinfo/python-list

How should I compare two txt files separately coming from windows/dos and linux/unix

2009-06-10 Thread higer
IgnoreNewline which can ignore the difference of new line flag in diffrent platforms? If not,I think filecmp may be not a good file comparison module. Thanks, higer -- http://mail.python.org/mailman/listinfo/python-list

Re: How should I compare two txt files separately coming from windows/dos and linux/unix

2009-06-11 Thread higer
On Jun 11, 1:08 pm, John Machin wrote: > Chris Rebert rebertia.com> writes: > > > > > > > On Wed, Jun 10, 2009 at 8:11 PM, higer gmail.com> wrote: > > > I just want to compare two files,one from windows and the other from > > > unix. But I do not w

Re: How should I compare two txt files separately coming from windows/dos and linux/unix

2009-06-11 Thread higer
On Jun 11, 11:44 am, Chris Rebert wrote: > On Wed, Jun 10, 2009 at 8:11 PM, higer wrote: > > I just want to compare two files,one from windows and the other from > > unix. But I do not want to compare them through reading them line by > > line. Then I found there is a filecmp

failed to build decompyle/unpyc project on WindowsXP

2009-06-12 Thread higer
Maybe everyone know that decompyle(hosted on SourceForge.net) is a tool to transfer a .pyc file to .py file and now it does only support Python 2.3 or the below. I have found a project named unpyc which can support Python version 2.5. Unpyc project is build on decompyle which is hosted on google co

Re: failed to build decompyle/unpyc project on WindowsXP

2009-06-12 Thread higer
On Jun 12, 4:55 pm, higer wrote: > Maybe everyone know that decompyle(hosted on SourceForge.net) is a > tool to transfer a .pyc file to .py file and now it does only support > Python 2.3 or the below. I have found a project named unpyc which can > support Python version 2.5. Unpy

question about a command like 'goto ' in Python's bytecode or it's just a compiler optimization?

2009-06-16 Thread higer
My Python version is 2.5.2; When I reading the bytecode of some pyc file, I always found that there are many jump command from different position,but to the same position. You can see this situation in following code(this bytecode is just from one .pyc file and I don't have its source .py file): .

Re: question about a command like 'goto ' in Python's bytecode orit's just a compiler optimization?

2009-06-17 Thread higer
Hi,all: I'm sorry that I did not make my question clear. What I mean is that what the souce code would look like that will be compiled to such bytecodes. Regards, higer -- http://mail.python.org/mailman/listinfo/python-list

Re: question about a command like 'goto ' in Python's bytecode or it's just a compiler optimization?

2009-06-17 Thread higer
On Jun 17, 8:29 pm, John Machin wrote: > On Jun 17, 1:40 pm, higer wrote: > > > My Python version is 2.5.2; When I reading the bytecode of some pyc > > file, I always found that there are many jump command from different > > position,but to the same position. You c