A good stuff for newbie for learning programming. Learning basics of Python language based on Learn Python - The Hard Way course.
- Windows, Linux or Mac OS X
- Python 2.7
- Pip (Python Package Manager)
- on Linux: Most of the Linux distributions should have installed Python by default
- on Windows: Download Python at: https://www.python.org/downloads/windows/ and run installer
- on Mac OS X: Download Python at: https://www.python.org/downloads/mac-osx/
- on Linux: Most of the Linux distributions should have enabled Python by default, so simply open terminal and type python to see if everything works.
- on Windows: add
/PythonXX
(e.g.C:/Python27
) intoPath
environmental variable. Location of the Python directory depends on your configuration. Next, re-run terminal window and typepython
- in order to check installed version of the Python, type:
python --version
- in order to exit python console type
exit()
Like an art, code has a style too. This style is general guide if you want to learn how a developer writing a clean code and better readability. https://www.python.org/dev/peps/pep-0008
Pip is a Python Package Manager.
- Download: https://raw.github.com/pypa/pip/master/contrib/get-pip.py script
- Execute:
python get-pip.py
- pip.exe and easy_install.exe files now should be located at: /PythonXX/Scripts (e.g. C:/Python27/Scripts)
- Add /PythonXX/Scripts (e.g. C:/Python27/Scripts) directory into Path environmental variable.
- Re-run terminal window
- Type
pip
, to check if package manager works - You can type
pip --version
, in order to check version of the pip
- Open terminal
- Type
sudo apt-get install python-pip
- Open terminal
- Type
brew install python3
This command will install python and pip.
- In order to install desired package just type
pip install desired_package
(e.g.pip install Flask
) - If you are working on Linux, type
sudo pip install desired_package
(e.g.sudo pip install Flask
) - Index of available packages can be found at: https://pypi.python.org/pypi/
- List of installed packages can be displayed with
pip freeze
command.