Python: how to share a local directory on the web

A simple way to share a local directory on internet (temporarily) can be performed with Python. First, go to the directory you want to share and then type:

[admin@localhost Work] python -m SimpleHTTPServer 7000
Serving HTTP on 0.0.0.0 port 7000 ...

Now the entire directory could be accessed on the network by typing http://:7000 in a web browser.

To stop the sharing, just press Ctrl + C .

Example : I want to share my music directory . So I will move to my music directory through cd command and type there python -m SimpleHTTPServer 7000 where 7000 is the port number. Then I will tell the ip of my machine to the person with whom I want to share my data. In the browser he types http://:. Screenshots of the same is shown below :

Please follow and like us:
This entry was posted in Python and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published.