- Python Network Programming - Home
- Python Network Introduction
- Python Networking - Environment Setup
- Python Networking - Internet Protocol
- Python Networking - IP Address
- Python Networking - DNS Lookup
- Python Networking - Routing
- Python Networking - HTTP Requests
- Python Networking - HTTP Response
- Python Networking - HTTP Headers
- Python Networking - Custom HTTP Requests
- Python Networking - Request Status Codes
- Python Networking - HTTP Authentication
- Python Networking - HTTP Data Download
- Python Networking - Connection Re-use
- Python Networking - Network Interface
- Python Networking - Sockets Programming
- Python Networking - HTTP Client
- Python Networking - HTTP Server
- Python Networking - Building URLs
- Python Networking - WebForm Submission
- Python Networking - Databases and SQL
- Python Networking - Telnet
- Python Networking - Email Messages
- Python Networking - SMTP
- Python Networking - POP3
- Python Networking - IMAP
- Python Networking - SSH
- Python Networking - FTP
- Python Networking - SFTP
- Python Networking - Web Servers
- Python Networking - Uploading Data
- Python Networking - Proxy Server
- Python Networking - Directory Listing
- Python Networking - Remote Procedure Call
- Python Networking - RPC JSON Server
- Python Networking - Google Maps
- Python Networking - RSS Feed
Python Network Programming Resources
Python Network - Internet Protocol
The Internet Protocol is designed to implement a uniform system of addresses on all of the Internet-connected computers everywhere and to make it possible for packets to travel from one end of the Internet to the other. A program like the web browser should be able to connect to a host anywhere without ever knowing which maze of network devices each packet is traversing on its journey. There are various categories of internet protocols. Thes protocols are created to serve the needs of different types of data communication between different computers in the internet.
Python has several modules to handle each of these communication scenarios. The methods and functions in these modules can do the simplest job of just validating a URL or also the complex job of handling the cookies and sessions. In this chapter we will look at the most prominent python modules used for internet protocols.
Internet Protocols
| Protocol | Python Module Name | Description |
|---|---|---|
| HTTP | urllib.request | Opening the HTTP URL |
| HTTP | urllib.response | Create a reponse object for a url request |
| HTTP | urllib.parse | To break Uniform Resource Locator (URL) strings up in components like (addressing scheme, network location, path etc.), |
| HTTP | urllib.robotparser | It finds out whether or not a particular user agent can fetch a URL on the Web site that published the robots.txt file. |
| FTP | ftplib | implements the client side of the FTP protocol. You can use this to write Python programs that perform a variety of automated FTP jobs, such as mirroring other FTP servers. |
| POP | poplib | This module defines a class, POP3, which encapsulates a connection to a POP3 server to read messages from a email server |
| IMAP | imaplib | This module defines three classes, IMAP4, IMAP4_SSL and IMAP4_stream, which encapsulate a connection to an IMAP4 server to read emails. |
| SMTP | smtplib | The smtplib module defines an SMTP client session object that can be used to send mail to any Internet machine with an SMTP listner deamon. |
| Telnet | telnet | This module provides a Telnet class that implements the Telnet protocol to access a server thorugh teleent. |
Each of them is discussed in detail in the subsequent chapters.