# python_study **Repository Path**: xiaoyi-study/python-study ## Basic Information - **Project Name**: python_study - **Description**: No description available - **Primary Language**: Python - **License**: Not specified - **Default Branch**: dev - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-12-11 - **Last Updated**: 2025-06-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: Python ## README # python_study # 组件 技术 | 说明 | 官网 ----|-----------|---- PySnooper| 调试,展示调用详情 | https://github.com/cool-RR/PySnooper Salvo| a simple command line tool to send some load to an HTTP(S) endpoint.| https://github.com/tarekziade/salvo #### pip安装 ``` python3 get-pip.py --user -i https://pypi.douban.com/simple/ ``` 如果报错ModuleNotFoundError: No module named 'distutils.util' ``` sudo apt-get install python3-distutils ``` 加入到环境变量 ``` /home/eric/.local/bin/ ``` ##### 升级pip ``` /usr/bin/python3 -m pip install --upgrade pip -i https://pypi.douban.com/simple/ ``` #### 依赖安装 格式化 ``` pip3 install pylint --user -i https://pypi.douban.com/simple/ ``` ``` pip install --user -r requirements.txt -i https://pypi.douban.com/simple/ ``` 性能测试 ```shell pip install salvo ``` salvo http://localhost:5000 -c 10 -n 100 #### 我折腾过的知识 1. pyforest 插件,import懒加载 1. 图像处理:生成词云、生成照片墙 1. python可以使用函数作为参数使用,可以理解为回调函数? ```python class _WorkItem(object): def __init__(self, future, fn, args, kwargs): self.future = future # 下面这个是函数形参 self.fn = fn self.args = args self.kwargs = kwargs def run(self): if not self.future.set_running_or_notify_cancel(): return try: # 把参数传入函数 result = self.fn(*self.args, **self.kwargs) except BaseException as exc: self.future.set_exception(exc) # Break a reference cycle with the exception 'exc' self = None else: self.future.set_result(result) ``` 1. python 连接rabbitmq 1. [Python 动态变量名定义与调用](https://www.runoob.com/w3cnote/python-dynamic-var.html)