I\'m trying to set up a server with python from mac terminal.
I navigate to folder location an use:
python -m SimpleHTTPServer
Bu
You can allow the server to reuse an address with allow_reuse_address.
Whether the server will allow the reuse of an address. This defaults to
False
, and can be set in subclasses to change the policy.
import SimpleHTTPServer, SocketServer
PORT = 8000
httpd = SocketServer.TCPServer(("", PORT), SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd.allow_reuse_address = True
print "Serving at port", PORT
httpd.serve_forever()