Posts

Showing posts from November, 2016

Simple Python Script To Create A WebServer

In this post, you will learn to create a web server just by executing a simple python script which is below. ##################### START OF SCRIPT ######################### import sys import getopt import BaseHTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler def start(argv):     HandlerClass = SimpleHTTPRequestHandler     ServerClass = BaseHTTPServer.HTTPServer     Protocol = "HTTP/1.0"     if sys.argv[1:]:         try:             opts, args = getopt.getopt(argv, "hp:", ["port="])         except getopt.GetoptError:             print "Error Try Again"             sys.exit()        ...