摘要: Samba is a free and open-source software package that provides seamless file and print services to SMB/CIFS clients. Samba is freely available, unlike 阅读全文
posted @ 2020-09-04 15:39 nevermore_29 阅读(241) 评论(0) 推荐(0) 编辑
摘要: Python中threading的join和setDaemon的区别[带例子] python的进程和线程经常用到,之前一直不明白threading的join和setDaemon的区别和用法,今天特地研究了一下。multiprocessing中也有这两个方法,同样适用,这里以threading的joi 阅读全文
posted @ 2020-06-03 15:44 nevermore_29 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 本篇博客将介绍zmq应答模式,所谓应答模式,就是一问一答,规则有这么几条 1、 必须先提问,后回答 2、 对于一个提问,只能回答一次 3、 在没有收到回答前不能再次提问 上代码,服务端: #coding=utf-8'''Created on 2015-10-10回复请求@author: kwsy20 阅读全文
posted @ 2020-06-03 14:06 nevermore_29 阅读(413) 评论(0) 推荐(0) 编辑
摘要: import paramiko ssh = paramiko.SSHClient() print ssh.get_host_keys() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(hostname="1 阅读全文
posted @ 2019-11-27 15:49 nevermore_29 阅读(337) 评论(0) 推荐(0) 编辑
摘要: import urllib2 req=urllib2.Request('https://xxxx') resp=urllib2.urlopen(req) >>> resp=urllib2.urlopen(req) Traceback (most recent call last): File "<s 阅读全文
posted @ 2019-11-19 16:04 nevermore_29 阅读(186) 评论(0) 推荐(0) 编辑
摘要: lambda 匿名函数的使用 加上filter的混合使用: filter后面的跟的参数是function和string(当然也可以是list) 阅读全文
posted @ 2019-09-06 14:18 nevermore_29 阅读(1764) 评论(0) 推荐(0) 编辑
摘要: 利用如下命令查看文件格式 :set ff 或 :set fileformat 可以看到如下信息 fileformat=dos 或 fileformat=unix 利用如下命令修改文件格式 :set ff=unix 或 :set fileformat=unix :wq (存盘退出) 最后再执行文件 # 阅读全文
posted @ 2019-06-18 11:11 nevermore_29 阅读(656) 评论(0) 推荐(0) 编辑
摘要: dd if=/dev/zero of=new_img.img bs=1M count=20 //生成20M的文件,bs块的大小,count块的数量 mkfs.ext3 new_img.img //格式化ext3 mount new_img.img /mnt/new //挂载 cp -r linpac 阅读全文
posted @ 2019-06-11 16:10 nevermore_29 阅读(1459) 评论(0) 推荐(0) 编辑
摘要: re.findall 在字符串中找到正则表达式所匹配的所有子串,并返回一个列表,如果没有找到匹配的,则返回空列表。 注意: match 和 search 是匹配一次,findall 匹配所有。 re.search 扫描整个字符串并返回第一个成功的匹配 匹配成功re.search方法返回一个匹配的对象 阅读全文
posted @ 2019-06-05 14:04 nevermore_29 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 使用@property 在绑定属性时,如果我们直接把属性暴露出去,虽然写起来很简单,但是,没办法检查参数,导致可以把成绩随便改: s = Student() s.score = 9999 这显然不合逻辑。为了限制score的范围,可以通过一个set_score()方法来设置成绩,再通过一个get_s 阅读全文
posted @ 2019-05-13 10:16 nevermore_29 阅读(100) 评论(0) 推荐(0) 编辑