Python Device Management TutorialA Python Networking Tutorial (Preston Rohner)
Setting Up Your Environment – about 20 minutes
We’ll presume you’re using a civilized operating system and that you already have Python installed. If you’re not in this situation then you can install Python pretty easily.
Once you have Python running you can verify that your version is at least 3 by running this command in a terminal window:
python --version. On some systems you may find that you have multiple versions of Python installed and available. In that case you may have to run a slightly modified command like
python3 --version. Once you confirm how to run Python 3 you’re in pretty good shape.
Paramiko is an easy to use Python library that enables you to run connect to SSH hosts and execute commands on the host. Sweet! It implements the SSH2 protocol so you can feel good about its security.
To install Paramiko you use pip) which usually comes with your Python installation. You’ll need to be sure that you run the correct version of
pip. For example, if you’re executing
python3 then you’ll want to execute
pip3. The command to install Paramiko is
pip3 install paramiko.
You can use any text editor you like to write your Python code. There are many choices out there. Atom is an outstanding cross-platform and free editor from Github. You can certainly use vim or any other editor you like. You can also treat yourself very nicely by using PyCharm Community Edition.