摘要: 1 import getopt 2 import sys 3 def usage(): 4 print 'this is a usage.' 5 def main(): 6 try: 7 print sys.argv 8 #sys.argv[0],表... 阅读全文
posted @ 2015-10-13 15:39 自由清风 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 序.multiprocessingpython中的多线程其实并不是真正的多线程,如果想要充分地使用多核CPU的资源,在python中大部分情况需要使用多进程。Python提供了非常好用的多进程包multiprocessing,只需要定义一个函数,Python会完成其他所有事情。借助这个包,可以轻松完... 阅读全文
posted @ 2015-09-20 18:46 自由清风 阅读(300) 评论(0) 推荐(0) 编辑
摘要: opensuse13.2国内源和设置命令ustc-osshttp://mirrors.ustc.edu.cn/opensuse/distribution/13.2/repo/oss/ustc-non-osshttp://mirrors.ustc.edu.cn/opensuse/distributio... 阅读全文
posted @ 2015-09-12 21:52 自由清风 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 1. In setting file: ROOT_PATH='/home/ronglian/project/taskschedule' STATIC_URL = '/static/' STATICFILES_DIRS=( # P... 阅读全文
posted @ 2015-08-24 22:58 自由清风 阅读(222) 评论(0) 推荐(0) 编辑
摘要: from django.db.models import get_app, get_models, get_modelfrom django.db import models#get the certain modelsisense_model=get_model('fastlogin','sis_... 阅读全文
posted @ 2015-08-24 22:54 自由清风 阅读(130) 评论(0) 推荐(0) 编辑
摘要: For we need to connect the postgres db in project very frequently, so write the follows class: 1 import psycopg2 2 #finish the work with task schedule... 阅读全文
posted @ 2015-08-24 22:33 自由清风 阅读(126) 评论(0) 推荐(0) 编辑
摘要: In everbright task schedule project, we need some daemon process to do certain work, here is a example of daemon class: 1 #encoding=utf-8 2 #!/usr/b... 阅读全文
posted @ 2015-08-24 22:25 自由清风 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 今天帮同事用Python写了一个小工具,实现了在linux下批量文件名和去掉windows 文件到linux过程中产生^M的脚本,代码如下: 1 !/opt/exptools/bin/python 2 import os,os.path,sys 3 import shutil,string 4 di... 阅读全文
posted @ 2015-08-24 21:38 自由清风 阅读(192) 评论(0) 推荐(0) 编辑
摘要: When working ALU IMS Patch team, we need to static the SU duration to add it to the patch report, the duration time alway is hard work, so I write the... 阅读全文
posted @ 2015-08-24 21:31 自由清风 阅读(185) 评论(0) 推荐(0) 编辑
摘要: Some time we need to record the logging information in multiple module, however if we use the follows logging configuration would lead the log cannot ... 阅读全文
posted @ 2015-08-24 21:20 自由清风 阅读(278) 评论(0) 推荐(0) 编辑