Share files quickly using python3

You can enable quick file sharing using python3 by activating its built-in internal webserver

 


python3 -m http.server

The default webserver will listen to port 8000, you can change to any port above 1024 without root privileges by specifying the port number after the command:


python3 -m http.server 9090

Quick and Dirty Network File sharing with Python

Ever find yourself in need to share file over the network quickly, but find yourself lacking time to setup a proper NFS or samba share? Here’s a way to do this with the good old Python CLI.

  • First, go to the directory that you want to share, for example ~/Desktop
  • Then run this command "python -m SimpleHTTPServer"
  • You may access the folder from a remote computer using any webrowser using the url – http://192.168.1.20:8000, change the ip address accordingly
Simple HTTP Server
file sharing with python

You may find this technique offers limited options to share files, but its a real time saver!