04 2017 档案

摘要:itertools itertools.count(1) chain cycle accumulate collections OrderedDict deque 阅读全文
posted @ 2017-04-18 10:29 Mirgo 阅读(146) 评论(0) 推荐(0)
摘要:2d为占位符,标准化输出结果 第一个print ,为空格 ,第二个print 默认输出换行符。 print(*objects, sep=' ', end='\n', file=sys.stdout) 如果没有打印对象, print() 只打印一个 结束符号 end. 列表推导式为: 'sep'.jo 阅读全文
posted @ 2017-04-07 11:52 Mirgo 阅读(401) 评论(0) 推荐(0)
摘要:摄像头安装 参见:http://www.eeboard.com/bbs/thread-38684-1-1.html #有问题都可以在网上找到解决方法 sudo raspi-config Enable Camera #raspistill 拍照 -v:调试信息查看。 -w:图像宽度 -h:图像高度 - 阅读全文
posted @ 2017-04-06 17:43 Mirgo 阅读(6206) 评论(0) 推荐(0)
摘要:with语句需要支持上下文管理协议的对象, 上下文管理协议包含__enter__和__exit__两个方法。with语句建立运行时上下文需要通过这两个方法执行进入和退出操作。 先执行__enter__()方法,然后将返回值赋值给了q,再执行with下面的语句,最后执行__exit__()方法。 阅读全文
posted @ 2017-04-06 15:44 Mirgo 阅读(166) 评论(0) 推荐(0)
摘要:#(a[,b]) 形式 []为可选 b存在时去掉[] https://docs.python.org/2/library/functions.html#max 英文版 http://python.usyiyi.cn/translate/python_278/library/functions.htm 阅读全文
posted @ 2017-04-06 15:01 Mirgo 阅读(136) 评论(0) 推荐(0)
摘要:1 import os 2 3 pylist = [] #储存指定文件夹中的所有文件路径 4 def print_directory(sPath): 5 for sChild in os.listdir(sPath): 6 sChildPath = os.path.join(sPath,sChil... 阅读全文
posted @ 2017-04-04 22:21 Mirgo 阅读(1904) 评论(0) 推荐(0)
摘要:1 import os 2 def print_directory(sPath): 3 for sChild in os.listdir(sPath): 4 sChildPath = os.path.join(sPath,sChild) 5 print 'a',sChildPath 6 if os.path.isdir(sChi... 阅读全文
posted @ 2017-04-04 20:28 Mirgo 阅读(117) 评论(0) 推荐(0)
摘要:1.最简单的例子 阅读全文
posted @ 2017-04-03 22:53 Mirgo 阅读(137) 评论(0) 推荐(0)
摘要:url_for 阅读全文
posted @ 2017-04-01 15:53 Mirgo 阅读(127) 评论(0) 推荐(0)
摘要:Python输入正整数n,不大于n的数i,符合i的所有因子的平方和为完全平方数则相加 阅读全文
posted @ 2017-04-01 11:24 Mirgo 阅读(3135) 评论(0) 推荐(0)