Tech and travel

A one line webserver

2008-03-03

Python has a built in webserver, that shows the contents of the directory it’s started in. Here’s how you run it :

python -c "from SimpleHTTPServer import test; test()"

This is invaluable if you have to copy some files across to another machine. It won’t work across the internet, but on a local network it can’t be beat. Yesterday I had to move a 2.4 Gig ISO file from the laptop PC to my Mac. Just put in a crossover cable, run the Python one liner and Bob’s your uncle.

BTW : the port used by default is 8000. So http://ip_address:8000 will get you to the right place.

Copyright (c) 2026 Michel Hollands