Extreme API with Python

Table Of Contents
Extreme API with Python
Page | 7
Part no.9036931-00 Rev AA February 2021
2.1.3 Virtual Environment
The easiest way to manage multiple packages, modules and libraries is to work with virtual
environments. If you do not use a virtual environment, every time you install a new package, module, or
library, it is added into the global Python installation. This becomes problematic if you install packages
with dependencies that may require older or more recent versions of modules you are already using. In
these cases, some applications can fail as versions of existing modules are changed.
A virtual environment creates a fresh copy of the Python global environment. You can create multiple
virtual environments and install the packages you want only into the environment you specify, without
breaking existing installations and applications.
HTTPS://docs.python.org/3/library/venv.html
Note: How you create and manage virtual environments has changed with Python 3.6. Make
sure to use the recommended methods.
2.1.4 PIP
The best tool for installing new modules and libraries is PIP, which is highly recommended, and installed
by default with Python since release 3.4.
HTTPS://docs.python.org/3/installing/index.html
2.1.5 Editors and IDE
You will need a text editor to work with a programming language. Although nearly any text editor will do
the job, specialized editors and IDEs (integrated development environments) can help simplify your
workflow.
Many popular text editors and IDEs have Python support built-in, for example:
- Vim
- Sublime Text
- Notepad++
- Visual Studio Code
PyCharm
Spyder
Jupyter
These editors and environments may provide a color scheme to quickly identify reserved words,
functions, and variables. Many also have an integrated help system, and intelligent auto-completion.
Depending on the tool, auto-completion may propose functions and methods associated with variables,
depending on various factors.
Typically, if you use a simple text editor, you test your code from the command line in a separate
window. Using Python, simply type python (or python3) to enter the Python interactive shell and type
and test your code.