Hour 20. Using the Network
What You’ll Learn in This Hour:
The Python network modules
How to interact with email and web servers
How to create your own client/server applications
These days, it’s almost a necessity for programs to be able to interact with networks. Fortunately,
there are lots of different modules available to help write network-aware Python applications that can
interact with lots of different types of network servers. In this hour, you’ll first take a look at the
different network modules available for Python, and then you’ll explore how to use Python scripts to
interact directly with email servers and web servers. Finally, you’ll wrap up this hour by creating
your own client/server programs using Python.
Finding the Python Network Modules
The Python v3 language supports lots of different networking features. However, because of the
modular approach to Python programming, you often have to find just the right network module to use
for your specific networking needs. Table 20.1 shows the different network-related modules that you
can use in your Python v3 programs.