![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
开发
木叶之秋
这个作者很懒,什么都没留下…
展开
-
python3中的一些坑
参考链接(https://www.kawabangga.com/posts/2245)理解Python的UnboundLocalError(Python的作用域)今天写代码碰到一个百思不得解为什么会出错的代码,简化如下:x = 10def func(): if something_true(): x = 20 print(x) func()意图很明显...转载 2018-12-05 10:57:35 · 413 阅读 · 0 评论 -
Python多线程报错之RuntimeError
写多线程脚本,运行的时候报错File “/usr/local/lib/python2.6/threading.py”, line 465, in startraise RuntimeError(“thread.init() not called”)RuntimeError: thread.init() not called原因是线程类中构造函数__init__()中未调用父类的初始化方法,...转载 2019-04-18 11:19:55 · 1055 阅读 · 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 · 212 阅读 · 0 评论 -
python中logging的运用
参考链接(https://segmentfault.com/a/1190000003008066)(https://blog.csdn.net/z_johnny/article/details/50812878)快速应用import loggingfrom logging.handlers import TimedRotatingFileHandler #加载模块gp...转载 2018-12-05 14:14:42 · 383 阅读 · 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 · 437 阅读 · 2 评论