随笔分类 -  Python

摘要:eval(str) 函数:将字符串 str 当成有效的表达式来求值并返回计算结果常见作用:1,计算字符串中有效的表达式,并返回结果In [55]: eval('pow(10,2)') # 函数Out[55]: 100In [57]: eval('10 ** 2') # 表达式Out[57]: 100 阅读全文
posted @ 2017-06-26 20:57 小沐枫 阅读(256) 评论(0) 推荐(0)
摘要:Python 的生成器运用仿佛是最完美的 xing爱,生成器本身和循环代表男女,结束代表同时达到高潮,不是很精准,但很有趣啊!哈哈哈,一下记住了 阅读全文
posted @ 2016-06-05 21:49 小沐枫 阅读(166) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2016-03-24 18:51 小沐枫 阅读(1) 评论(0) 推荐(0)
摘要:os.system()无法获得到输出和返回值 os.popen()output = os.popen('cat /proc/cpuinfo')print output.read()返回的是 file read 的对象,对其进行读取 read() 的操作可以看到执行的输出,读取不了返回值 comman 阅读全文
posted @ 2016-03-08 12:56 小沐枫 阅读(531) 评论(0) 推荐(0)
摘要:Examples Generating Excel Documents Using Python’s xlwt 使用Python的xlwt生成Excel文档示例 Here are some simple examples using Python’s xlwt library to dynamica 阅读全文
posted @ 2015-12-28 15:43 小沐枫 阅读(6390) 评论(0) 推荐(0)