
开发
木叶之秋
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python3中的一些坑
参考链接(https://www.kawabangga.com/posts/2245) 理解Python的UnboundLocalError(Python的作用域) 今天写代码碰到一个百思不得解为什么会出错的代码,简化如下: x = 10 def func(): if something_true(): x = 20 print(x) func() 意图很明显...转载 2018-12-05 10:57:35 · 470 阅读 · 0 评论 -
Python多线程报错之RuntimeError
写多线程脚本,运行的时候报错 File “/usr/local/lib/python2.6/threading.py”, line 465, in start raise RuntimeError(“thread.init() not called”) RuntimeError: thread.init() not called 原因是线程类中构造函数__init__()中未调用父类的初始化方法,...转载 2019-04-18 11:19:55 · 1148 阅读 · 0 评论 -
bash shell坑
这是一个简单的 if 判断。 if [ `ps ax | grep -i 'open-falcon' |wc -l` == 2 ] || [ `ps ax | grep -i 'open-falcon' | awk -F " " '{print $7}'|head -n 1` == "/home/work/open-falcon/agent/config/cfg.json" ];then ech..原创 2019-03-05 17:24:07 · 257 阅读 · 0 评论 -
python中logging的运用
参考链接(https://segmentfault.com/a/1190000003008066) (https://blog.youkuaiyun.com/z_johnny/article/details/50812878) 快速应用 import logging from logging.handlers import TimedRotatingFileHandler #加载模块 gp...转载 2018-12-05 14:14:42 · 419 阅读 · 0 评论 -
python学习
官方文档(https://docs.python.org/zh-cn/3/library/typing.html) cookbook(https://python3-cookbook.readthedocs.io/zh_CN/latest/c07/p03_attach_informatinal_matadata_to_function_arguments.html) 给函数参数增加元信息 你写好了...原创 2019-04-24 09:47:37 · 544 阅读 · 2 评论