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.