
python
董武明
这个作者很懒,什么都没留下…
展开
-
ubuntu install python2.7
【代码】ubuntu install python2.7。原创 2022-09-29 10:41:00 · 1803 阅读 · 0 评论 -
Python Minio 上传文件到S3同时配置文件的公共读权限
【代码】Python Minio 上传文件到S3同时配置文件的公共读权限。原创 2022-09-13 19:29:54 · 3270 阅读 · 4 评论 -
macOS - pip install scipy Error: No BLAS/LAPACK libraries found
macOS - pip install scipy Error:numpy.distutils.system_info.NotFoundError: No BLAS/LAPACK librariesfound. Note: Accelerate is no longer supported.查出mac系统的版本标识:$ pip install packaging$ python -c"from packaging import tags; print('\n'.join([str(t) f原创 2022-04-08 11:58:28 · 1797 阅读 · 0 评论 -
Mac install MySQL-python 报错 _mysql.c:44:10: fatal error: ‘my_config.h‘ file not found
正常来说直接执行pip安装,就是可以的,但是MySQL-python偏偏比较独特pip install MySQL-python报错:_mysql.c:44:10: fatal error: 'my_config.h' file not found #include "my_config.h" ^~~~~~~~~~~~~ 1 error generated. error: command 'cc' failed with exit status 1原创 2021-06-30 22:35:07 · 372 阅读 · 0 评论 -
修改~/.pip/pip.conf 后 使用的源地址不变,没有使用最近的配置
查找pip.conf 配置的地址:echo $PIP_CONFIG_FILE修改 $PIP_CONFIG_FILE 的文件即可 ????原创 2021-03-10 21:02:38 · 1166 阅读 · 0 评论 -
mac pip install xxx ld:unknown option: --no-as-needed or library not found for -lssl
pip install qtdigest-cffild: unknown option: --no-as-needed clang: error: linker command failed with exit code 1 (use -v to see invocation) error: command 'clang' failed with exit status 1因为LD加了参数–no-as-needed 删除即可:echo $LDFLAGS-Xlinker --no-as-n原创 2020-08-31 16:17:49 · 949 阅读 · 0 评论 -
gunicorn 启动flask 失败
gunicorn 启动flask 失败, print("\nError: %s" % str(e), file=sys.stderr)[xxxxxxxx jenkins]$ sudo gunicorn -c gunicorn.py --reload xxxxx:appTraceback (most recent call last):File “/bin/gunicorn”, line 7, in from gunicorn.app.wsgiapp import runFile “/usr/lib原创 2020-05-22 16:54:03 · 1604 阅读 · 0 评论 -
Vim Error detected while processing function <SNR>59_RunPyflakes: line 53: E927: Invalid action: ''
安装vim配置后,vim python文件报错:Error detected while processing function 59_RunPyflakes:line 53:E927: Invalid action: ‘’解决办法:修改 call setqflist(b:qf_list, ‘’) ==> call setqflist(b:qf_list, ’ ‘)及’'中...原创 2019-02-28 16:55:12 · 1670 阅读 · 0 评论 -
sqlalchemy query 统计匹配包含xxxx类型的数据
匹配match_type 类型的数据格式:session.query(Tablename).filter(Tablename.xxxx.like(‘%%%s_%%’ % match_type)其他详细: 条件ret = session.query(Users).filter_by(name=’alex’).all() ret = session.query(Users).filt...原创 2018-07-27 16:52:33 · 1258 阅读 · 0 评论 -
mac pip install MySQL-python IndexError: string index out of range
mac pip install MySQL-python IndexError: string index out of rangepip install mysql Collecting mysql Downloading https://files.pythonhosted.org/packages/06/ef/c4efbf2a51fb46aba9be03a973638d9539c...原创 2018-07-03 19:09:22 · 4979 阅读 · 9 评论 -
Python 程序员需要知道的 30 个技巧
如果你让一个 Python 程序员说一下 Python 的优势,他会说简洁以及高可读是最有影响力的优势。为证明上述两点,在这个 Python 教程里,我们将聊聊许多基本的 Python 建议和技巧。我们从开始使用 Python 便收集这些有用的捷径(贴士与技巧)。分享一些我们知道,同时又能造福于人的知识,有什么事情比这更棒吗?过去我们分享过 一些给初学者的 Python 编程贴士转载 2017-06-06 11:55:30 · 598 阅读 · 0 评论 -
Python:eval的妙用和滥用
eval()函数十分强大,官方demo解释为:将字符串str当成有效的表达式来求值并返回计算结果。so,结合math当成一个计算器很好用。其他用法,可以把list,tuple,dict和string相互转化。见下例子:a = "[[1,2], [3,4], [5,6], [7,8], [9,0]]"b = eval(a)bOut[3]: [[1, 2], [3, 4]转载 2017-04-14 16:02:25 · 1272 阅读 · 0 评论 -
Nginx+uWSGI+Django原理
Nginx+uWSGI+Django原理Python的Web开发中,如果使用Django框架,那么较为成熟稳定的服务器架构一般是Nginx+uWSGI+Django。而为什么一定要三个结合在一起呢?直接使用Django的runserver来启动服务器进程,或者uWSGI+Django可不可以呢?为什么? 概念说明:APP(应用程序),就是开发者写的应用程序,例如dj转载 2017-04-17 18:40:37 · 706 阅读 · 0 评论 -
统计python脚本中 shell命令输出文本的行数
统计python脚本中 shell命令输出文本的行数 username=xxxx Count_num=len(os.popen('cat CaseBuildFailed.list | cut -d " " -f1-3 | grep -w ' + username).readlines()) print Case_num 好别扭的统计啊 - -#原创 2017-02-21 16:02:27 · 1811 阅读 · 0 评论 -
python 调用 shell python shell 间变量传递
Python -> shell:1.环境变量import os var=123或var=’123’ os.environ[’var’]=str(var) #environ的键值必须是字符串 os.system(’echo $var’) [python] view plain copyimport os var=123或var=’123’ os.environ[’var’转载 2017-02-21 15:44:23 · 3138 阅读 · 0 评论 -
Python常见文件操作函数示例
Python常见文件操作函数示例 os.path 模块中的路径名访问函数 分隔 basename() 去掉目录路径, 返回文件名 dirname() 去掉文件名, 返回目录路径 join() 将分离的各部分组合成一个路径名 split() 返回(dirname(), basename()) 元组 spl原创 2014-02-26 16:59:14 · 738 阅读 · 0 评论