As a part of this topic we will see setting up development environment for python.
Setting up in local machines
Mac: Most Mac OS X computers already have Python 2.x installed, which is perfectly fine to use. The best way to install the latest version is to use HomeBrew to activate and manage them.
Linux: Python is included with most distributions of Linux. Check your current version and be sure to upgrade using the package manager, if necessary.
Windows: Just download Python and be sure to select the option that adds Python.exe to your system path during installation.You can do this by selecting the option next to “Add python.exe to path,” and then choosing your local hard drive as the install location.
For this course we will be using pycharm.
You can download IDE for the following link.
- Select appropriate OS and download.
- Complete installation process.
- Launch pycharm
Python Environment Variables
- PYTHONPATH – It has a role similar to PATH. This variable tells the Python interpreter where to locate the module files imported into a program. It should include the Python source library directory and the directories containing Python source code. PYTHONPATH is sometimes preset by the Python installer.
- PYTHONSTARTUP – contains the path of an initialization file containing Python source code. It is executed every time you start the interpreter. It is named as .pythonrc.py in Unix and it contains commands that load utilities or modify PYTHONPATH. .pythonrc.py is similar to .bashrc
- PYTHONCASEOK – is used in Windows to instruct Python to find the first case-insensitive match in an import statement. Set this variable to any value to activate it.
- PYTHONHOME – alternative module search path. It is usually embedded in the PYTHONSTARTUP or PYTHONPATH directories to make switching module libraries easy.