Simple Serve
Quickly rewrote Vector's simple serve to have Python 3 compatibility, tab-completion, PEP8 formatting, and zero dependencies (besides python preinstalled).

#!/usr/bin/env python
import os
from getpass import getuser

# Python 2 Compatability
   input = raw_input
except NameError:

   from SimpleHTTPServer import SimpleHTTPRequestHandler
   import SocketServer
except ImportError:
   from http.server import SimpleHTTPRequestHandler as SimpleHTTPRequestHandler
   import socketserver as SocketServer

# Tab completion
   import readline
   readline.parse_and_bind("tab: complete")
except ImportError:

USER_ABORT = "\n[!] User Aborted."

def quickshell():
   cwd = os.getcwd()
   print("[+] OS Shell in " + cwd)
   print("[+] Enter 'Q' to quit")

       while True:
           command = input("\n%s$ " % getuser())
           if command.lower().strip() == 'q':
               print("\n[!] Exiting shell.")
   except KeyboardInterrupt:

def main():
   print("\n[+] Basic HTTP Server.\n")

   default = input(
       "[?] Default Config? [Y]es/[N]o: ").lower()[0]

   if default == 'y':
       port = DEFAULT_PORT
       ip_address = DEFAULT_IP
       print("\n[+] Default settings loaded.\n")
       print("[+] Specify custom values.\n")
       port = int(input("Enter port %d: " % DEFAULT_PORT) or DEFAULT_PORT)
       ip_address = input("Enter host %s: " % DEFAULT_IP) or DEFAULT_IP

       print("\n[+] Invoke a shell to make adjustments in server directory?")
       invoke = input("[?] [Y]es/[N]o: ").lower()[0]
       if invoke == 'y':
           print("[+] Okay.")

   print("[+] Starting Server.\n")

   handler = SimpleHTTPRequestHandler
       '.webapp': 'application/x-web-app-manifest+json',

       httpd = SocketServer.TCPServer((ip_address, port), handler)
   except Exception as e:
           "\n[!] Critical. An exception was raised with the following error message")

   # Catching keyboard interrupt for aesthetics purposes
       print("[+] Serving at %s:%d" % (ip_address, port))
   except KeyboardInterrupt:

if __name__ == "__main__":

Possibly Related Threads…
Thread Author Replies Views Last Post
  [TOOL] Blackpearl simple toolbox Whoami 2 22,588 10-09-2018, 06:21 PM
Last Post: Whoami
  [Python]Ever need to serve some files locally? Vector 7 29,684 02-16-2018, 04:45 PM
Last Post: Vector
  [Python] A simple music downloader Jake 0 10,315 08-13-2015, 02:50 PM
Last Post: Jake