Speak to our team now +44 (0)1737 821590

Python for network engineerss

A 5 day
training course

Python training course description

This Python course focusses on teaching Python for use in network automation and network DevOps. We focus on getting delegates up and running with Python and network automation as quickly as possible rather than making them great programmers. In other words we concentrate on enabling delegates to use network automation libraries such as netmiko and NAPALM and APIs such as NETCONF rather than enabling delegates to produce object oriented programs. Hands on sessions use Cisco and Juniper devices.

Key outcomes from this course

By the end of the course delegates will be able to:
  • Run Python programs.
  • Read Python programs.
  • Write Python programs.
  • Debug Python programs.
  • Automate network tasks with Python programs.
  • Configure network devices with Python.
  • Collect data from network devices with Python.

Python training course details

Who will benefit:
Network engineers.
TCP/IP Foundation
5 days

Training approach

This structured course uses Instructor Led Training to provide the best possible learning experience. Small class sizes ensure students benefit from our engaging and interactive style of teaching with delegates encouraged to ask questions throughout the course. Quizzes follow each major section allowing checking of learning. Hands on sessions are used throughout to allow delegates to consolidate their new skills.

Overall rating:

This is a new course

Customer reviews

"Hard concepts were explained very simply."
J. S. Framestore CFC
"Excellent presentation - very good course structure."
B. M. London Internet Exchange

Python training course contents

What is Python?
Programming languages, Why Python? Python in interactive mode, Python scripts, ipython, Python version 2 versus version 3. A simple Python script. Comments.
Hands on: Installing Python, Hello world.

A network example
On box vs off box python. telnet, ssh, NETCONF, HTTP, APIs, manufacturers and API support, analysis of a simple telnetlib program.
Hands on: Using Python to retrieve the configuration from a network device. Using wireshark to analyse the actions.

Python basics
I/O, operators, variables and assignment, types, indentation, loops and conditionals.
Hands on: Modifying the telnet program, changing configurations on a network devices.

Functions, classes and methods
What are functions, calling functions, builtin functions, useful builtin functions, file handling, classes, objects, creating instances.
Hands on: Storing configurations in files, configuring devices from files, using an inventory file to work on multiple devices.

Libraries and modules
Modules, files and packages, import, from-import, Python standard library, other packages, pip install, executing other programs. Managing python libraries.
Hands on: Using pip, installing and using ipaddress, subprocess to access netsnmp. For the more advanced, using the sockets library.

Paramiko and netmiko
SSH, enabling SSH on devices, keys. Paramiko versus netmiko, example scripts. pexpect.
Hands on: Configuring VLANs from Python.

Gathering facts using previous methods, SNMP review, pySNMP GET, pySNMP and SNMPv3.
Hands on: Walking a MIB from Python.

ncclient and pyEZ
NETCONF, Enabling NETCONF on devices, A first ncclient script, device handlers, get_config, edit_config, copy_config, delete_config, commit, validate, pyEZ, utils_config, utils.sw.
Hands on: Configuration using ncclient and PyEZ. This session is expanded for those interesting in JunOS automation.

Manipulating configuration files
Builtin functions, string handling. Unicode. Sequences, strings, lists, tuples. Dictionaries. TextFSM. Regular expressions. JSON, YAML, XML, YANG, Jinja2, templates.
Hands on: Jinja2 templating with Python to configure network devices.

Getters, configuration operations, supported devices, NAPALM transport, Config-replace, Config-merge, Compare config, Atomic changes, rollback. Example NAPLAM scripts.
Hands on: Using NAPALM to gather facts, Using NAPALM for configuration management.

What is REST, HTTP methods, GET, POST, cURL, Postman, python requests library. RESTCONF, a RESTCONF example.
Hands on: Modifying a configuration using a REST API.

What is scapy, Scapy in interactive mode, Scapy as a module.
Hands on: Packet crafting from Python.

Errors and exceptions, Exception handling, try, except. Memory management. Garbage collection. Context management, With.
Hands on: Improving Python code.

Writing your own functions, Writing your own classes. pyntc.
Hands on: Writing reusable code.

Why Choose Us

SNT trainers score an average of over 90% on the three main areas of:
  • Ability to teach
  • Technical knowledge
  • Answering questions
“Excellently presented by a very knowledgeable and enthusiastic trainer.” P.D. General Dynamics

We limit our maximum class size to 8 delegates; often we have less than this. This ensures optimal interactivity between delegates and instructor.
"Excellent course. The small class size was a great benefit…" M.B. IBM

We write our own courses; courseware does not just consist of slides and our slides are diagrams not bullet point text. A typical chapter provides clearly defined objectives with a chapter overview, slides with text underneath, a quiz at the end to check the learning of the students. Hands on exercises are at the end and are used to reinforce the theory.

See Dates & Prices for this course

To enquire about this course

To reserve this course online