Python: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 6: | Line 6: | ||
= Install a new module = | = Install a new module = | ||
[https://pypi.python.org/pypi The Python Package Index (PyPI)] is the definitive list of packages (or modules | [https://pypi.python.org/pypi The Python Package Index (PyPI)] is the definitive list of packages (or modules) | ||
<pre> | <pre> | ||
sudo apt-get install python- | sudo apt-get install python-pip | ||
pip install SomePackage | |||
pip show --files SomePackage | |||
pip install --upgrade SomePackage | |||
pip uninstall SomePackage | |||
</pre> | </pre> | ||
Revision as of 12:44, 13 April 2014
How to run a python code
python mypython.py
Install a new module
The Python Package Index (PyPI) is the definitive list of packages (or modules)
sudo apt-get install python-pip pip install SomePackage pip show --files SomePackage pip install --upgrade SomePackage pip uninstall SomePackage
If a package has been bundled by its creator using the standard approach to bundling modules (with Python’s distutils tool), all you need to do is download the package, uncompress it and type:
python setup.py install
How to list all installed modules
help('modules')
How to find the location of installed modules
There are different ways
- python -v
- import MODULENAME
- help('MODULENAME')
Using this way, I find the 'RPi' module is installed under /usr/lib/python2.7/dist-packages.
Projects based on python
- pithos Pandora on linux
- Many Raspberry Pi GPIO projects
- GeneScissors It also requires pip and scikit-learn packages.
- KeepNote It depends on Python 2.X, sqlite and PyGTK.
Qt for GUI development
- http://zetcode.com/gui/pyqt4/
- http://wiki.wildsong.biz/index.php/PyQt Create GUI in Qt Designer and convert/use it in PyQt.