
Python
Meow323
这个作者很懒,什么都没留下…
展开
-
使用functools.wraps完善装饰器
在python中使用装饰器(decorator)会使得被装饰函数的名称和帮助文档发生错乱,如下所示:>>> def decorator(f):... def wrapper(*args, **kwargs):... """wrapper Docstring"""... print('Calling decorated function')...原创 2016-09-20 20:40:19 · 921 阅读 · 0 评论 -
line_profiler增强,运行脚本无需删除@profile装饰器
line_profiler原创 2016-09-21 23:01:03 · 4145 阅读 · 2 评论 -
解决pycharm在debug console中输入中文UnicodeEncodeError的问题
使用pycharm在debug python 2时,无法在debug console中输入中文,输入中文便会提示如下错误:UnicodeEncodeError: 'ascii' codec can't encode characters in position 1-2: ordinal not in range(128)直接导致带有中文的代码在进行debug时极不方便,解决方法如下:\AppData原创 2017-12-14 23:00:04 · 1325 阅读 · 0 评论