python中的编码方式
摘要:
python中常用的字符串格式有两种:一种是str类型,一种是bytes类型。str类型和bytes类型的转换:1 >>> str1 = 'hello world!'2 >>> type(str1) ##查看str1的数据类型3 <class 'str'>4 >>> b = str1.encode('utf-8') ##str到bytes的转换5 >>> b,type(b)6 (b'hello world!', <class 'byt 阅读全文
posted @ 2013-05-14 21:55 甘泉love若水 阅读(496) 评论(0) 推荐(0)
浙公网安备 33010602011771号