08 2016 档案
python subprocess阻塞
摘要:import select import os import subprocess import time import fcntl args = ['python','./fetch_file2.py',ip,path] proc = subprocess.Popen(args, stdout=subprocess.PIPE,stderr=subprocess.PIPE,close_fds=... 阅读全文
posted @ 2016-08-28 13:11 妞溜溜 阅读(3548) 评论(0) 推荐(0)
linux查看父子进程
摘要:python多进程代码 http://blog.csdn.net/yfkiss/article/details/6729364 Linux下多线程查看工具(pstree、ps、pstack) test.py 1、ps -ef |grep test.py 2、pstree -p 12237 3、 ps 阅读全文
posted @ 2016-08-23 14:34 妞溜溜 阅读(28231) 评论(0) 推荐(0)
python subprocess.Popen 非阻塞
摘要:1、非阻塞设置subprocess.Popen(args, stdout=subprocess.PIPE,stderr=subprocess.PIPE) 若子进程没有执行完 直接proc.stderr.read() 阻塞,若设置成非阻塞抛出如上异常 阅读全文
posted @ 2016-08-18 17:32 妞溜溜 阅读(11680) 评论(0) 推荐(0)
linux错误码
摘要:1、通过代码输出错误码以及其代表的含义 具体可以参考errno和os模块 errno.errorcode os.strerror(n) 2、有些shell命令返回码为命令自身定义 eg: man rsync 阅读全文
posted @ 2016-08-17 17:49 妞溜溜 阅读(431) 评论(0) 推荐(0)
python中logging
摘要:1、root logger以及logger斧子关系 http://www.pythonclub.org/modules/logging 输出: foo2016-08-08 17:58:09,006 - foo2016-08-08 17:58:09,006 - DEBUG - foo 2、Stream 阅读全文
posted @ 2016-08-08 10:13 妞溜溜 阅读(235) 评论(0) 推荐(0)