Python
Collections
- PythonRobotics
- Comprehensive Python Cheatsheet
- Problem Solving with Python
- Scipy Lecture Notes
- PythonTemplate
- Python Template is a Cookiecutter template for creating a python project
- Linear Regression in Python using numpy + polyfit (with code base)
Libraries
- eigency, Cython interface between the numpy arrays and the Matrix/Array classes of the Eigen C++ library
- cupoch, Robotics with GPU computing
- kinpy, Simple kinematics calculation toolkit for robotics
- PyTorch3D provides efficient, reusable components for 3D Computer Vision research with PyTorch
Tutorials
Tools
- 2to3, Automated Python 2 to 3 code translation
Quick Notes
pip install
From a Git Repository
python -m pip install git+https://github.com/django/django.git@main
pip install
From a local dir
pip install -e /path/to/package
-e
installs the package in a way, that you can edit the package, but it requires that the package source stay in the same place (/path/to/package
in this case) forever.
glob
通配符获取文件列表
Add this in your python code:
glob.glob("./*.jpg")
获取当前目录下的jpg文件列表
__init__.py的作用
参考链接 https://www.cnblogs.com/lands-ljk/p/5880483.html
__init__.py
文件的作用是将文件夹变为一个Python模块,Python 中的每个模块的包中,都有__init__.py 文件。
通常__init__.py 文件为空,但是我们还可以为它增加其他的功能。我们在导入一个包时,实际上是导入了它的__init__.py文件。这样我们可以在__init__.py文件中批量导入我们所需要的模块,而不再需要一个一个的导入。
当导入模块时,解释器按照sys.path列表中的目录顺序来查找导入文件。
import sys
print(sys.path)
Other Tools
- VScode Configure Python autoComplete extraPaths
- Use Pylance for autoCompletion
- TabNine, Autocompletion for Jupyter Notebook
Issues
General
Make python3 as default on Linux
sudo apt install python-is-python3
This wiil symlinks /usr/bin/python
to python3
ROS-related
编译ros提示缺少em模块
pip3 install empy