Python
zuyi532
这个作者很懒,什么都没留下…
展开
-
Python中使用中文--SyntaxError: Non-ASCII character
Defining the Encoding Python will default to ASCII as standard encoding if no other encoding hints are given. To define a source code encoding, a magic comment must be placed into th原创 2013-04-08 14:31:09 · 1597 阅读 · 0 评论 -
python字符串连接的N种方式
http://www.openstack.org.cn/bbs/forum.php?mod=viewthread&tid=506 python中有很多字符串连接方式,今天在写代码,顺便总结一下:1 最原始的字符串连接方式:str1 + str22 python 新字符串连接语法:str1, str23 奇怪的字符串方式:str1 str24 % 连接字符串:‘name:%s;转载 2013-04-10 10:49:19 · 658 阅读 · 0 评论 -
Python——UnicodeEncodeError: 'ascii' codec can't encode/decode characters
初学Python被编码格式搞的很头大,以下bug是遇到的编码问题之一:【BUG】UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-15: ordinal not in range(128)或者UnicodeDecodeError: 'ascii' codec can't decode byte 0转载 2013-04-25 19:19:38 · 43587 阅读 · 10 评论