pybull.cublog.cn
pybull
全部博文(4)
词汇(0)
PHP(0)
Shell(0)
Python(1)
Windows(0)
Linux(2)
2011年(1)
2009年(3)
分类: Python/Ruby
2009-09-25 16:18:03
def getParentPath(): import os dirList = os.getcwd().split('/') if dirList == 2: return '/' else: dirList.pop() return '/'.join(dirList)
def appLog(logFile): import logging from logging.handlers import TimedRotatingFileHandler formatter = logging.Formatter("[%(asctime)s] {%(levelname)s} %(message)s") logger = logging.getLogger() handler = TimedRotatingFileHandler(logFile, 'midnight', 1, 0) handler.setFormatter(formatter) logger.addHandler(handler) logger.setLevel(logging.DEBUG) return logger
上一篇:[转]自动安装Flash 64bit的脚本
下一篇:查看UUID的方法
登录 注册