技术宅,fat-man

增加语言的了解程度可以避免写出愚蠢的代码

导航

2012年8月14日 #

python:能自动记录时间,动作发生的所在文件和行数的日志类

摘要: tnLog.py#!/usr/bin/env python# -*- coding: utf-8 -*-import osimport sysimport timeimport loggingimport inspect'''import inspectdef test(): a = inspect.stack()[1] print a得到一个元组,如:(<frame object at 0x8604aa4>, 'test.py', 10, 'function_one', ['\t\tprint get_current 阅读全文

posted @ 2012-08-14 16:28 codestyle 阅读(1776) 评论(0) 推荐(0)