Skip to content

Latest commit

 

History

History
73 lines (59 loc) · 1.54 KB

README.md

File metadata and controls

73 lines (59 loc) · 1.54 KB

Python

环境配置

虚拟环境和包依赖等

性能分析

profiler.md

gdb运行进程调试

pygdb.md

单元测试

python -m unittest test_xxx.py TestClass
文件服务器便捷搭建
python -m pyftpdlib -d .
编译加密
# 依赖: apt install python3-dev or yum install python3-devel.x86_64

nuitka

批量重命名
#!/usr/bin/env python
import os
path = "."
fileList = os.listdir(path)
for i in fileList:
    if ".ts" != os.path.splitext(i)[-1]:
        continue
    oldname = path + os.sep + i
    newname = ".".join(oldname.split(".")[2:])
    os.rename(oldname, newname)
pip安装
# py2
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
sudo python get-pip.py
# py3
# 依赖:apt install python3-distutils
wget https://bootstrap.pypa.io/get-pip.py
sudo python3 get-pip.py 
hash和编解码

base64 md5 sha256

QA
1
  • Q: ModuleNotFoundError: No module named '_ctypes'
  • A: sudo yum install libffi-devel -y
2
  • Q: 致命错误:Python.h:没有那个文件或目录
  • A: sudo yum install python3-devel
3
  • Q: psycopg2安装失败, centos

  • A: yum install postgresql-devel*

  • Q: psycopg2安装失败, mac

  • A: pip3 install psycopg2-binary