# 48_python_study **Repository Path**: linux2014/48_python_study ## Basic Information - **Project Name**: 48_python_study - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-01-08 - **Last Updated**: 2025-09-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README --- ### python官网: https://www.python.org/ https://docs.python.org/zh-cn/3.12/contents.html #### Python/C API Reference Manual: https://docs.python.org/3.7/c-api/index.html #### python developer guide--parser: https://devguide.python.org/internals/parser/#parser #### Python Developer’s Guide https://devguide.python.org/ #### pypy: https://pypy.org/download.html ##### Build Python: ``` ./configure --with-pydebug && make -j $(nproc) ./configure --with-pydebug && make -j8 PCbuild\build.bat -e -d ``` --- ### pdb: https://docs.python.org/zh-cn/3.12/library/pdb.html https://zhuanlan.zhihu.com/p/690690101 ### pudb: https://www.cnblogs.com/brt2/p/13756614.html --- ### python函数的参数次序: 标准参数,元组参数,字典参数; --- --- ### python项目: https://cloud.tencent.com.cn/developer/special/studyPython --- ### 还有python源码项目: https://github.com/xmq1024/part_21 https://github.com/Dujltqzv/Some-Many-Books https://github.com/trluper/trluper.github.io https://github.com/baiyongan/advanced-python-techniques --- ### cython https://cython.readthedocs.io/en/latest/ https://www.cnblogs.com/kuenwa/p/18572051 --- ### python高阶编程: 装饰器 上下文管理器 生成器 进程、线程、协程(asyncio,async,await); (https://www.doubao.com/thread/w20c959c9e099b0ac) 进程--操作系统分配资源的基本单位; 线程--操作系统调度执行体的基本单位; 协程--用户空间内的轻量级线程,调度在用户态完成,内核态不参与; #### 任务类型和方案: 多进程--CPU密集型; 多线程/多协程--IO密集型; GIL,(https://www.doubao.com/thread/w0d40f61c3f60d1d3) 在Python中,GIL(Global Interpreter Lock,全局解释器锁) 是CPython解释器(Python 最主流的实现)中的一个核心机制; 一个进程内最多只有一个线程获得GIL; 线程获得GIL之后才可执行字节码; GIL的释放:时间片耗尽,IO操作,time.sleep(); --- ### python3的优化方案: https://cloud.tencent.com/developer/article/2518754 cpu密集型--多进程/多协程; io密集型--多线程; 降低内存--__slots__,生成器; 引入cython,借助C语言优化; --- ### python打包: https://cloud.tencent.com.cn/developer/article/2340396?policyId=1004 https://blog.csdn.net/wuShiJingZuo/article/details/135578475 https://cloud.tencent.com/developer/article/2550690 #### PyInstaller(推荐) ``` # 安装 pip install pyinstaller # 打包命令(基础版) pyinstaller -F -w code-summar-tool.py # 高级版(添加图标) pyinstaller -F -w -i app.ico code-summar-tool.py ``` #### Nuitka(编译为原生二进制) ``` # 安装 pip install nuitka # 打包命令 nuitka --standalone --onefile --windows-disable-console code-summar-tool.py ``` --- ### python内存分析 ``` pympler, muppy--对象列表; summary--汇总统计; ObjectTracker--追踪统计; memory_profiler tacemalloc, gc ``` https://cloud.tencent.com/developer/information/%E5%BB%BA%E8%AE%AE%E4%BD%BF%E7%94%A8%E5%93%AA%E7%A7%8DPython%E5%86%85%E5%AD%98%E5%88%86%E6%9E%90%E5%99%A8%EF%BC%9F https://cloud.tencent.com/developer/article/2332909?from=15425&frompage=seopage https://cloud.tencent.com/developer/article/1459715?from=15425&frompage=seopage https://blog.csdn.net/strayeagle/article/details/142177219 https://gavin-wang-note.github.io/2018/09/26/python_memory_profiler/ --- --- ### python函数的参数列表: 标准参数,位置参数(*args,元组),关键字参数(**kwargs,字典); ### python3的命令行传参数: 在Python中,你可以通过命令行参数向你的脚本传递参数。这通常是通过sys.argv来实现的,sys.argv是Python标准库sys模块的一部分。 --- ### python库 https://zhuanlan.zhihu.com/p/533695865 https://mp.weixin.qq.com/s?__biz=MzkwMDM4Njc5Nw==&mid=2247493868&idx=1&sn=a0f277605c325d138313e9ef8d26a059&chksm=c046726ef731fb78bbe63d183ce58311723c772705f277b1edead624c7d2aa92aa2eabf6cc92&scene=27 ``` NetworkX Neupy SciPy SymPy SimPy ``` --- ### python实现的架构图工具 https://github.com/mingrammer/diagrams --- ### python3的内置方法 [docs/python_method.md] ### python3,包、模块、函数、对象的内置属性: [docs/python_attr.md] ### python3的包管理pip [docs/pip_pkg.md] --- --- ---