Standard Gems: SimpleHTTPServer.test()
Have you ever needed to share some files real quick with real low setup? You can start up a web server from the current directory on port 8000 with a single line of python.
python -c "from SimpleHTTPServer import test; test()"

5 comments:
Even simpler (in recent versions):
python -m SimpleHTTPServer
Nice! I used to keep a copy of 'a-ftp.exe' around for simple file sharing, but it seems MSFT has tagged it as spyware and started deleting it :(
Very handy, thanks.
With Billy Joex' new pyftpdlib something alike is possible for an FTP-server:
python -m pyftpdlib.FTPServer
see
http://billiejoex.altervista.org/pyftpdlib.html
Here's a quick hack to serve a non-8000 port, 19028 in this case:
python -c "from SimpleHTTPServer import test; import sys; sys.argv = [None, 19028]; test()"
Hey Bill, more concise:
python -c "from SimpleHTTPServer import t; t()" 19028
Post a Comment