上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 71 下一页
摘要: os.mkdir()创建单个不存在的空目录,无法创建多个或者已经存在的含有文件的同名目录 os.makedirs() 能够递归创建多个目录,如果目录已经存在即使都是空的或者目录已经存在且含有文件,则引发OS.Error异常 os.listdir() .枚举出当前目录下所有文件以及目录,仅针对当前层级 阅读全文
posted @ 2020-02-26 16:32 不带R的墨菲特 阅读(222) 评论(0) 推荐(0)
摘要: import os def local_rm(dirpath): if os.path.exists(dirpath): files = os.listdir(dirpath) for file in files: filepath = os.path.join(dirpath, file).rep 阅读全文
posted @ 2020-02-26 16:10 不带R的墨菲特 阅读(1924) 评论(0) 推荐(0)
摘要: 差集>>> #两个列表的差集3 >>> ret3 = list(set(a) ^ set(b)) #两个列表的差集 >>> ret4=list(set(a).difference(set(b))) # a not same b ,retrun = a-b if a-b>0 else {} 并集 获取 阅读全文
posted @ 2020-02-24 17:56 不带R的墨菲特 阅读(3236) 评论(0) 推荐(0)
摘要: http://c.biancheng.net/view/1009.html 阅读全文
posted @ 2020-02-24 13:00 不带R的墨菲特 阅读(106) 评论(0) 推荐(0)
摘要: debug shell:执行 sh -x test.sh vi test.sh :set fileformat=unix :wq解决问题原因是我在windows pycharm 写的格式不符合unix导致语法错误 阅读全文
posted @ 2020-02-24 11:48 不带R的墨菲特 阅读(270) 评论(0) 推荐(0)
摘要: requirements.txt 包含paramiko,pysfp.setuptools,适用python版本3.6.6+ 前提编译安装python wget wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgz tar -xvf 阅读全文
posted @ 2020-02-23 16:10 不带R的墨菲特 阅读(446) 评论(0) 推荐(0)
摘要: vi /etc/locale.conf 修改LANG="zh_CN.gbk" 最后执行source /etc/locale.conf 即可永久生效,下次登录,中文就不会乱码了。 阅读全文
posted @ 2020-02-22 22:58 不带R的墨菲特 阅读(2407) 评论(0) 推荐(0)
摘要: 首先密钥登陆远程的原理 client 端 将公钥放在远程机器authorized_keys: 使用 ssh-copy-id app@ip 接着在client机器生成密钥 使用ssh-keygen -t rsa 生成密钥对,id_rsa: 编写测试脚本: import paramiko hostnam 阅读全文
posted @ 2020-02-22 14:30 不带R的墨菲特 阅读(892) 评论(0) 推荐(1)
摘要: 阅读全文
posted @ 2020-02-16 20:38 不带R的墨菲特 阅读(121) 评论(0) 推荐(0)
摘要: 以上是关于进程池的使用,截下来开始介绍如何使用多进程,由于multiprocessing 实现比concurrent.futures 实现更加底层这里还是推荐大家使用concurrent.futures ThreadExecutor ,因为他有更加友好的封装 最后我要介绍一下进程之间还有一种通信的方 阅读全文
posted @ 2020-02-16 14:29 不带R的墨菲特 阅读(172) 评论(0) 推荐(0)
上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 71 下一页