![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
小楼听風
只要在路上,就没有到不了的远方!
展开
-
Python格式化输出—%s
我是Python初学者,这也是我的第一篇博客,谨记录学习到的知识,方便复习。今天学习《像计算机科学家一样思考Python》一书时,其中有这样一段代码: for p in True, False: for q in True, False: print ("%-7s %-7s %-7s" % (p, q, eval(expression))) 搞不...原创 2018-12-17 17:32:25 · 950 阅读 · 0 评论 -
python打包可执行文件命令—pyinstaller使用
pyinstaller是一个第三方库,可以将python源代码打包成可执行程序。windows下的操作:1、使用pip命令安装pyinstaller库: pip install pyinstaller2、打包命令: pyinstall -F <源文件名.py>3、pyinstall其他参数: --clean:清除打包过程中生成的临时目录:_pychache_、buil...原创 2018-06-08 15:21:21 · 5393 阅读 · 0 评论 -
python错误解决TypeError: first arg must be callable
直接切入正题。问题:我在使用_thread.start_new_thread(func(), ())时,报错:TypeError: first arg must be callable。分析:由于传入的function名带了括号,相当于在此处调用这个方法。所以这个参数本来应该是方法名,却成了该方法的返回值。解决办法:去掉方法后的括号:_thread.start_new_thread(f...原创 2018-12-17 17:31:09 · 8071 阅读 · 1 评论