Web server on demmand

import sys, BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
protocol = "HTTP/1.0"
host = ""
port = 8888
server_address = (host, port)
HandlerClass.protocol_version = protocol
httpd = ServerClass(server_address, HandlerClass)
sa = httpd.socket.getsockname()
print "Serving HTTP on", sa[0], "port", sa[1], "..."

The above example serves all pages/files in the current directory, as long as the host:port combination is accessible.

Great if you want to quickly test javascript or send a document to your iphone!