Using Python to implement local file sharing methods in the same network

Source: Internet
Author: User
This article mainly introduces the use of Python to implement the local file sharing method in the same network, has a certain reference value, and now share to everyone, the need for friends can refer to

This article uses Python3 to start a simple HTTP server for sharing local files on the same network.

Start the HTTP server

Open the terminal, go to the folder where the target file is located, type the following command:

$ cd/users/zero/documents/localfiles# python-m http.server <port number>$ sudo python3-m http.server 8092Serving HTTP on 0.0.0.0 Port 8092 (http://0.0.0.0:8092/) ...

Generate a shared link

Open the browser and enter url:http://localhost:8092 to view the file locally. Then, type ifconfig in the terminal to see the native IP address, such as 192.168.199.154, and replace localhost with the link http://192.168.199.154:8092/.

Share Local Files

Share this link with anyone on the same network to enable local file sharing.

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.