Wednesday, 4 November 2015

How to create file server using python

We can use a simple python command to create our own server.

Install python : Welcome to Python.org

Open your console. (Terminal in Linux/Mac OSX and cmd in Windows).
Type the following:
python -m SimpleHTTPServer.

For python 3.0 and above : 

python -m http.server 7000


That's it! You have created your own file server. You can now access the files on this machine from other machines over the internet!





You can access the files on this server through your web browser. Just type the following:


http:// [ip-address-of-server]:8000








This will list all the files in the server, and you can browse and download any permitted files just like you do on a normal website.

To find the IP address, I have another section here.

2. How to find your own IP address:

i ) For Windows:

Type:
(windows key + r)
and press [enter].
Type
ipconfig




3. The IPv4 Address section is your required IP.

ii) For Linux/Mac OS X:

Open the terminal, type:

ifconfig





No comments:

Post a Comment