>>> s='\xd6\xd0\xce\xc4'
>>> print s
>>> 中文
>>> s1=s.decode('gbk').encode('utf-8')
>>> print s1
>>> 涓����
>>> file=open('c:\\t1','w')
>>> file.write(s1)
>>> file.close()

when i open c:\t1,i get 中文 in it,
how can i write  涓���� into  c:\t1??
>>> file.write(print s1)
  File "<stdin>", line 1
    file.write(print s1)
                   ^
SyntaxError: invalid syntax
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to