Book Image

Python Network Programming

By : Abhishek Ratan, Eric Chou, Pradeeban Kathiravelu, Dr. M. O. Faruque Sarker
Book Image

Python Network Programming

By: Abhishek Ratan, Eric Chou, Pradeeban Kathiravelu, Dr. M. O. Faruque Sarker

Overview of this book

This Learning Path highlights major aspects of Python network programming such as writing simple networking clients, creating and deploying SDN and NFV systems, and extending your network with Mininet. You’ll also learn how to automate legacy and the latest network devices. As you progress through the chapters, you’ll use Python for DevOps and open source tools to test, secure, and analyze your network. Toward the end, you'll develop client-side applications, such as web API clients, email clients, SSH, and FTP, using socket programming. By the end of this Learning Path, you will have learned how to analyze a network's security vulnerabilities using advanced network packet capture and analysis techniques. This Learning Path includes content from the following Packt products: • Practical Network Automation by Abhishek Ratan • Mastering Python Networking by Eric Chou • Python Network Programming Cookbook, Second Edition by Pradeeban Kathiravelu, Dr. M. O. Faruque Sarker
Table of Contents (30 chapters)
Title Page
Copyright
About Packt
Contributors
Preface
Index

Building asynchronous network applications with Twisted


Twisted is an event-driven network engine written in Python. Twisted can be used to develop asynchronous and publish/subscribe based Python applications.

Getting ready

You need to install the third-party Python module, twisted. This can be grabbed from PyPI (https://pypi.org/project/Twisted/). Both on Windows and Linux hosts, you may need to install some additional packages. The installation procedure is documented at https://twistedmatrix.com/trac/.

Follow the following guidelines to install Twisted in your Debian/Ubuntu based Linux distributions.

Twisted suggests against installing anything into global site-package. It recommends using virtualenv to set up isolated publish/subscribe modules. virtualenv is a product aimed to create isolated execution environments for Python. While we can indeed make Twisted work by directly installing the bundles using pip, we respect the suggestion of Twisted, and follow their installation guidelines...