Peter Otten wrote:
> ygao wrote:
>
> >>>> compile('U"中"','c:/test','single')
> >
> >>>> d=compile('U"中"','c:/test','single')
> >>>> d
> >
> >&
>>> compile('U"中"','c:/test','single')
>>> d=compile('U"中"','c:/test','single')
>>> d
>>> exec(d)
u'\xd6\xd0'
>>> U"中"
u'\u4e2d'
>>>
why is the result different?
a bug or another reason?
--
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/mail
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
thanks for your advice.
--
http://mail.python.org/mailman/listinfo/python-list
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_
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('unicod
>>> 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
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
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