Setting up development environment for Python
First thing you need to do is download Python from python.org and install it. If you’re using Mac, you already have Python 2.x installed on it, so you’re good to go, unless you want to install a newer version of Python.
There’s two versions of Python on the website: 2.x and 3.x. If you’re new to the language or unsure which one to use, just pick the 3.x version — it is the present and the future of the language as mentioned here.
Python.org website has documentation and bunch of guides to get you started in case you’re new to the language.
At this point you could already type python
in the terminal/command line to start the Python interpreter. If you’re on Windows, make sure you have the path set to the Python binaries (e.g. c:\python27
).
I use bypthon
instead of the built-in interpreter as it gives some additional functionality such as syntax highlighting, intellisense (auto-complete with suggestions, expected parameter list for Python functions) and some other things. You can install bpython
like this:
pip install bpython
If you don’t have pip
(tool for installing Python packages) check the quick instructions here on how to install it.
Once installed, type bpython
in your terminal to launch it and off you go!
Finally, I am using Visual Studio Code and Python Extension for actual development. This extensions provides support for code linting, debugging, Intellisense, code formatting, refactoring, unit tests, snippets and bunch more.
You can download Visual Studio Code from the above link, launch it and then install Python Extension by launching VS Code Quick Open (⌘+P) and paste the command ext install python
This will search through all Python extensions in Visual Studio marketplace. Installing the extensions is as simple as clicking the Install button.
Now you’re ready to do some Python development!
As with any other programming language, there’s a bunch of other useful tools and libraries when working with Python, such as virtualenv, Kite, etc.
What are some of your favorite tools or Python libraries?