Peter Otten wrote:
ygao wrote:
compile('U中','c:/test','single')
code object ? at 00F06B60, file c:/test, line 1
d=compile('U中','c:/test','single')
d
code object ? at 00F06BA0, file c:/test, line 1
exec(d)
u'\xd6\xd0'
U中
u'\u4e2d'
why is the result different?
a bug
compile('U中','c:/test','single')
code object ? at 00F06B60, file c:/test, line 1
d=compile('U中','c:/test','single')
d
code object ? at 00F06BA0, file c:/test, line 1
exec(d)
u'\xd6\xd0'
U中
u'\u4e2d'
why is the result different?
a bug or another reason?
--
when a function or method is called,how can get the module global
symbol table from which
it is called,not the module where it is defined(this is easy).
thanks!
--
http://mail.python.org/mailman/listinfo/python-list
I mean the way not passing parameter to the fonction or the method.
ygao wrote:
when a function or method is called,how can get the module global
symbol table from which
it is called,not the module where it is defined(this is easy).
thanks!
--
http://mail.python.org/mailman/listinfo/python
sorry,my poor english.
I got a solution from others.
I must use utf-8 for chinese.
import sys
reload(sys)
sys.setdefaultencoding(utf-8)
s='\xe9\xab\x98' #this uff-8 string
ss=U'\xe9\xab\x98'
ss1=ss.encode('unicode_escape').decode('string_escape')
s1=s.decode('unicode_escape')
s1==ss
sorry,my poor english.
I got a solution from others.
I must use utf-8 for chinese.
import sys
reload(sys)
sys.setdefaultencoding(utf-8)
s='\xe9\xab\x98' #this uff-8 string
ss=U'\xe9\xab\x98'
ss1=ss.encode('unicode_escape').decode('string_escape')
s1=s.decode('unicode_escape')
s1==ss
True
thanks for your advice.
--
http://mail.python.org/mailman/listinfo/python-list
in python
dd = \\xd6\\xd0\\xb9\\xfa
d = \xd6\xd0\xb9\xfa
but how to convert one to other ?
thanks.
--
http://mail.python.org/mailman/listinfo/python-list
import sys
sys.setdefaultencoding(utf-8)
s='\xe9\xab\x98' #this uff-8 string
ss=U'\xe9\xab\x98'
s
'\xe9\xab\x98'
ss
u'\xe9\xab\x98'
how do I get ss from s?
Can there be a way do this?
thanks!
--
http://mail.python.org/mailman/listinfo/python-list
Can ZConfig write apache conf file?
--
http://mail.python.org/mailman/listinfo/python-list
my question is as title!
thanks!
--
http://mail.python.org/mailman/listinfo/python-list
11 matches
Mail list logo