![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 74
kgblily205
这个作者很懒,什么都没留下…
展开
-
python中strip()函数的用法
strip是trim掉字符串两边的空格。lstrip, trim掉左边的空格rstrip, trim掉右边的空格strip (s [ ,chars ] )Return a copy of the string with leading and trailingcharacters removed.If chars is omittedor Non转载 2014-02-16 20:32:22 · 7203 阅读 · 1 评论 -
setuptools
一 setuptools 和easy_install setuptools:setuptools 是一组由PEAK(Python Enterprise Application Kit)开发的 Python 的 distutils 工具的增强工具,可以让程序员更方便的创建和发布 Python的egg 包,特别是那些对其它包具有依赖性的状况。 由 setuptools 创建和发布的包看起来和基于转载 2014-02-16 14:00:53 · 801 阅读 · 0 评论 -
Python 深入理解yield
只是粗略的知道yield可以用来为一个函数返回值塞数据,比如下面的例子:def addlist(alist): for i in alist: yield i + 1取出alist的每一项,然后把i + 1塞进去。然后通过调用取出每一项:alist = [1, 2, 3, 4]for x in addlist(alist): pri转载 2014-10-03 16:59:58 · 427 阅读 · 0 评论