摘要: 1. 连接FTP serverimport ftplibftp = ftplib.FTP(ftpserver, user, passwd)等同于import ftplibftp = ftplib.FTP()ftp.connect(ftpserver)ftp.login(user,passwd) 对... 阅读全文
posted @ 2015-12-02 18:02 道以万计 阅读(2082) 评论(0) 推荐(0) 编辑
摘要: 继电器常识: 继电器有三个接线柱:常开(NO),常闭(NC),接地(C) 如果连接的时间长,偶尔需要断电, 那么接NC 和 C, 这样继电器set on 时为断电。除此之外,继电器还可以控制按键,以及长按。 继电器接通时,该继电器的灯会亮。ZZR08有8个继电器,以一个字节表示其整体状态... 阅读全文
posted @ 2015-12-02 17:10 道以万计 阅读(766) 评论(0) 推荐(0) 编辑
摘要: 应用举例:1. usermod -g newuser newuser force use GROUP as new primary group. 一般时候是默认的,也是必须的(不能更改)。2. 指定用户所属的附加组list(用逗号分隔): 使newuser额外从属于staff.#usermod-G... 阅读全文
posted @ 2015-11-30 18:15 道以万计 阅读(369) 评论(0) 推荐(0) 编辑
摘要: 定义:[1, 2, 3] # An array that holds three Fixnum objects[-10...0, 0..10,] # An array of two ranges; trailing commas are allowed[[1,2],[3,4],[5]] # An a... 阅读全文
posted @ 2015-11-27 17:20 道以万计 阅读(593) 评论(0) 推荐(0) 编辑
摘要: # definefrench_string = "il \xc3\xa9tait une fois"long_string = "1 and a 2 and a 3 and a "puts data.join(' and a ')# numbernumber = 5puts "The number... 阅读全文
posted @ 2015-11-26 17:50 道以万计 阅读(488) 评论(0) 推荐(0) 编辑
摘要: 转载:http://www.scmeye.com/thread-1665-1-1.html入门Gerrit简介Gerrit是一个建立在Git版本控制系统之上,基于Web的代码审查工具,但如果你已经阅读过该指南,那么你可能已经知道了。介绍的目的就是然你回答这个问题,Gerrit是适合我的工具吗?它是否... 阅读全文
posted @ 2015-11-26 17:48 道以万计 阅读(20017) 评论(1) 推荐(0) 编辑
摘要: def union_list(l1, l2): result = [] if not l1: result.extend(l2) return result if not l2: result.extend(l1) retur... 阅读全文
posted @ 2015-04-09 17:27 道以万计 阅读(343) 评论(0) 推荐(0) 编辑
摘要: def score(dices_input): count = {}.fromkeys(range(1, 7), 0) points = 0 for dice_side in dices_input: count[dice_side] += 1 # print ... 阅读全文
posted @ 2015-03-31 17:22 道以万计 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.jb51.net/os/Ubuntu/141723.html1.gnome-terminal快捷键设置方法:系统 —> 首选项 ->键盘快捷键 -> 桌面 -> Run a Terminal 然后用鼠标选中该行,这时候要注意了:你想设置成什么快捷键,你就按相应的键即可,例... 阅读全文
posted @ 2015-01-13 14:34 道以万计 阅读(870) 评论(0) 推荐(0) 编辑
摘要: argparse: 解析命令行参数;http://www.cnblogs.com/snow-backup/p/4010751.htmllogging: 写日志;http://blog.csdn.net/chosen0ne/article/details/7319306xml.dom.minidom:... 阅读全文
posted @ 2014-12-11 14:58 道以万计 阅读(367) 评论(0) 推荐(0) 编辑