bytes和str之间的转换:
python调用windows_api的时候进程出现api只接受bytes型或int型的参数,而获取的参数则是str类型,此时就需要进行str和bytes之间的转换
bytes object b = b"example"
str object s = "example"
#str to bytes
bytes(s, encoding = "utf8")
#bytes to str
str(b, encoding = "utf-8")
#an alternative method
#str to bytes
str.encode(s)
#bytes to str
bytes.decode(b)
正则表达式是强有力的工具必须拿下:
http://www.cnblogs.com/huxi/archive/2010/07/04/1771073.html
encode的作用是将unicode编码转换成其他编码的字符串
decode的作用是将其他编码的字符串转换成unicode编码
eclipse中python中文问题解决方案:
http://www.cnblogs.com/linzhenjie/articles/2639113.html