2015年8月7日
摘要: 〇、python中对应的argc, argv需要模块:sys参数个数:len(sys.argv)脚本名: sys.argv[0]参数1: sys.argv[1]参数2: sys.argv[2]一、getoptopts,args = getopt.getopt ( [命令行参数列表], "短选项", ... 阅读全文
posted @ 2015-08-07 11:07 perel 阅读(2199) 评论(0) 推荐(0) 编辑
  2014年12月16日
摘要: yum install gccpip install uwsgi报错UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 ...解决:export LC_ALL=C报错:一堆c编译错解决:yum install python-devel 阅读全文
posted @ 2014-12-16 22:43 perel 阅读(145) 评论(0) 推荐(0) 编辑
  2014年11月25日
摘要: 一、10.2.0.5要求expdp导出a用户b表空间下的数据。expdp \'/ as sysdba\' directory=mydir dumpfile=1.dmp schemas=a exclude=table:\"in \(select table_name from dba_tables w... 阅读全文
posted @ 2014-11-25 15:19 perel 阅读(654) 评论(0) 推荐(0) 编辑
  2014年6月20日
摘要: 11.2.0.2,expdp报错: ORA-39126: Worker unexpected fatal error in KUPW$WORKER.GET_TABLE_DATA_OBJECTS []ORA-31642: the following SQL statement fails:BEGIN 阅读全文
posted @ 2014-06-20 15:53 perel 阅读(4319) 评论(0) 推荐(0) 编辑
  2014年6月9日
摘要: 一、profile,cProfile1. python -m cProfile myprogram.pypython -m profile myprog.py2. 使用import profile模块import profiledef profileTest(): ...if __name__ =... 阅读全文
posted @ 2014-06-09 10:38 perel 阅读(733) 评论(0) 推荐(0) 编辑
  2014年5月23日
摘要: 一、多进程池 二、concurrent.future Python 3.2+concurrent.futures.wait(fs, timeout=None, return_when=ALL_COMPLETED):wait等待fs里面所有的Future实例(由不同的Executors实例创建的)完成 阅读全文
posted @ 2014-05-23 10:23 perel 阅读(211) 评论(0) 推荐(0) 编辑
  2014年3月25日
摘要: 一、explain plan a)explain plan for select ... select * from table(dbms_xplan.display()); function display (table_name varchar2 default 'PLAN_TABLE', st 阅读全文
posted @ 2014-03-25 09:50 perel 阅读(230) 评论(0) 推荐(0) 编辑
  2014年2月20日
摘要: 一、读取1、xml.dom.minidomimport xml.dom.minidomdoc=xml.dom.minidom.parse(file)#xml.dom.minidom.parseString(string)root=doc.documentElementfor node in root.childNodes: #print node,node.nodeName,node.nodeValue,node.nodeType #,node.data (for textnode) if node.nodeName=='channel': #and node.nodeType 阅读全文
posted @ 2014-02-20 16:53 perel 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 1、#coding=utf8文本的字符编码s=u'xxxx'.encode('utf8')2、sys.getdefaultencoding,sys,setdefaultencoding转换缺省使用编码s.decode('utf8').encode('gbk')通常s.decode('utf8'),unicode也能正确输出3、sys.stdin.encoding,sys.stdout.encoding输出编码sys.stdout.encoding='gbk'改变标准输出流的编码方式的方法import 阅读全文
posted @ 2014-02-20 10:46 perel 阅读(250) 评论(0) 推荐(0) 编辑
  2014年2月10日
摘要: 一、clock#includeclock_t start,end;start=clock();end=clock();couttime_t start,end;start=time();//time(&start)end=time();coutstruct timespec start,end;//struct timespec {// time_t tv_sec; /* seconds */// long tv_nsec; /* nanoseconds */// };clock_gettime(CLOCK_PROCESS_CPUTIME_ID,&start);clock_ge 阅读全文
posted @ 2014-02-10 16:06 perel 阅读(394) 评论(0) 推荐(0) 编辑