Starting a Dead-Simple Webserver Using Python

technology.pngI ran across this post, which pointed out that the popular programming language Python has a built-in webserver.
It’s definitely not for anything like production use, but if you just want to share a few files over your home network, it’s great.   And because it’s Python, it should run pretty much the same no matter what operating system you have Python installed on.


The command is pretty simple – from a command prompt, type:

python -m SimpleHTTPServer

and you’ll be up and running.  Point the browser at your computer’s local IP address (find it on Windows, Mac, Linux) and port 8000.  So let’s say your computer is at  In the browser bar, you type
and boom!
Of course, me being me, this wasn’t enough.  So I made two bash scripts – one to call from a terminal window (like, from an alias), and one to call using Zenity so I could choose the directory.  They should also be embedded below; YMMV with those. While Zenity is cross-platform, bash isn’t.
With convention season coming up, this is an interesting alternative to carrying around thumbdrives, don’t you think?  Just remember to shut down the server when you’re not actively using it.
Terminal script:

Zenity GUI script:

Popular posts:

  • HOWTO Make Your Hamburger Helper Better
  • If there's one Nazi (or a racist) at the table...
  • Bash string padding with SED
  • Word Porn Quotes
  • The Complicated Mess When The Missing Stair Gets Noticed
  • SOLVED: Command line BPM (beats per minute) Analysis in Linux
  • Odds and Ends: Optimizing SSHFS, moving files into subdirectories, and getting placeholder images