Python client Programming

Source: Internet
Author: User
Tags file copy http file upload nntp remote ftp server file transfer protocol rsync

The last one said the most basic socket used for network communication. There are a number of sockets based protocols that form the core of most client server applications in the Internet today

In fact, these protocols are used to complete specific applications in a layer of encapsulation above sockets, which mainly include:

  1. File Transfer (FTP, SCP, etc.)
  2. Read Usenet newsgroups (NNTP)
  3. e-Mail Send (SMTP)
  4. Download e-mail from the server (POP3, IMAP), etc.

These protocols work in much the same way as the client/server examples previously introduced in socket programming

Internet client??

Well, before we realized the communication of two machines, what about the Internet? In fact, we are on the internet here The network model is also by a client server, I think you know what this is

Internet protocol??

The socket pass can only be a string, right? What does it say about TCP UDP protocol? What is the answer?

Here, we will learn more about the three Internet protocols--ftp, NNTP and POP3, and write out their client programs. Wildcard
Over these programs, you will find out how similar the APIs are to these protocols--because of the great benefits of maintaining interface consistency,
So, these similarities are taken into account at the beginning of the design-and, more importantly, you can learn how to write these agreements with other co-
A practical client program. Although we have only focused on these three agreements. After reading these agreements, you will be able to have enough letters
Heart and ability to write out any Internet Protocol client program.

File Transfer

The most popular thing in the Internet is the exchange of documents. File Exchange is everywhere. There are many protocols that can be used to transfer files over the Internet.

The most popular are File Transfer Protocol (FTP), Unix-to-unix Replication Protocol (UUCP), and Hypertext transfer of web pages
Protocol (HTTP). In addition, there are (under Unix) remote file copy instruction RCP (and more secure, more flexible SCP and rsync)

So far, http,ftp and Scp/rsync have been very popular. HTTP is primarily used for downloading and accessing Web page files
The service. It generally does not require the user to enter a login password to access files and services on the server. HTTP File Upload
The main loss request is to obtain a Web page (file download).

FTP of File transfer

On the ground floor, FTP uses only TCP (see section on previous network programming)-it does not use UDP. Also, FTP is a customer

The "different" example of end/server programming. Both the client and the server use two sockets to communicate: one is to control
and command Port (Port 21st), and the other is the data port (sometimes port 20th).

Protocol Workflow:

1. Client connects to remote FTP server
2. Client input user name and password (or "anonymous" and e-mail address)
3. Client to do various file transfer and information query operation
4. Client log out of remote FTP server, end communication

Python uses FTP??

I guess you know, there must be a module, yes, he's ftplib.

Well, actually if you have the need to transfer files across the network, you can use Python, which is simple and automated

Python client Programming

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.