Skip to Content
Python Network Programming Cookbook - Second Edition
book

Python Network Programming Cookbook - Second Edition

by Pradeeban Kathiravelu, Dr. M. O. Faruque Sarker
August 2017
Beginner
450 pages
13h 21m
English
Packt Publishing
Content preview from Python Network Programming Cookbook - Second Edition

How to do it...

In the Python Diesel framework, applications are initialized with an instance of the Application() class and an event handler is registered with this instance. Let's see how simple it is to write an echo server.

Listing 2.5 shows the code on the echo server example using Diesel as follows:

 #!/usr/bin/env python # Python Network Programming Cookbook, Second Edition -- Chapter - 2 # This program is optimized for Python 2.7.12. # It will work with Python 3.5.2 once the depedencies for diesel are sorted out. # It may run on any other version with/without modifications. # You also need diesel library 3.0 or a later version. # Make sure to install the dependencies beforehand. import diesel import argparse class EchoServer(object): ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Network Programming

Python Network Programming

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

Publisher Resources

ISBN: 9781786463999Supplemental Content