Python
逍遥明月-月依然美好
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python支持有参数调用式装饰器和无参数不调用式装饰器
def log(text): def decorator(func): def wrapper(*args, **kw): print('begin call') result = func(*args, **kw) if isinstance(text, str): p原创 2018-01-23 23:28:52 · 571 阅读 · 0 评论 -
利用map和reduce编写一个str2float函数
from functools import reduce def str2float(s): def get_num(n): digits = {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9} return digits[n原创 2018-01-10 16:39:18 · 688 阅读 · 0 评论 -
python IndentationError: unindent does not match any outer indentation level 错误
Mac用vim写python代码出现该问题。 出现该问题的原因是Tab和空格混用,可以将python文件用UltraEdit或Notepad++打开,选择显示空白字符,会直观看到Tab和空格。原创 2018-01-10 17:25:19 · 293 阅读 · 0 评论
分享