Speed up development with full-stack environments for every branch.

Learn More

A simple web server in python

1297 Runs 7233 Views 1474 Copies


sundip 66

published 4 years ago

    ## Creating a basic web server in python without 
    ## any external modules or dependencies
    import os
    import SimpleHTTPServer
    import SocketServer
    ## 'SimpleHTTPRequestHeader' is setup to serve up any 
    ## files located in the current directory
    Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
    httpd = SocketServer.TCPServer(("localhost", 80), Handler)
    print "serving at port: ", 80
    Please login/signup to get access to the terminal.

    Your session has timed out.

    Dismiss (the page may not function properly).