
Python学习笔记
阿特曼altman
半路上的数据工程师
展开
-
python的with语句理解
With语句是什么?Python’s with statement provides a very convenient way of dealing with the situation where you have to do a setup and teardown to make something happen. A very good example for this is t转载 2016-03-21 18:54:56 · 368 阅读 · 0 评论 -
python3中字符串问题
在python3中,bytes string和unicodestring是两种不同的类型。由于python3中,字符串str在内存中是以unicode表示,一个字符对应多个字节。如果在网上传输,就需要将str转化为以字节为单位的bytes。例如,在做套接字试验时,客户端与服务端经行数据传输时,不进行字符转换,会报错。如下,TypeError:'str' does not sup原创 2016-03-24 16:09:05 · 514 阅读 · 0 评论