August 2017
Beginner
450 pages
13h 21m
English
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): ...