old_contents: #!/usr/bin/env python2
  from SimpleHTTPServer import SimpleHTTPRequestHandler
  import BaseHTTPServer
  
  class CORSRequestHandler( SimpleHTTPRequestHandler ):
      def end_headers( self ):
          self.send_header( 'Access-Control-Allow-Origin', '*' )
          SimpleHTTPRequestHandler.end_headers(self)
  
  if __name__ == '__main__':
      BaseHTTPServer.test( CORSRequestHandler, BaseHTTPServer.HTTPServer )
new_contents: try:
      from http.server import SimpleHTTPRequestHandler
      import http.server as BaseHTTPServer
  except ImportError:
      from SimpleHTTPServer import SimpleHTTPRequestHandler
      import BaseHTTPServer
  
  
  class CORSRequestHandler( SimpleHTTPRequestHandler ):
      def end_headers( self ):
          self.send_header( 'Access-Control-Allow-Origin', '*' )
          SimpleHTTPRequestHandler.end_headers(self)
  
  if __name__ == '__main__':
      BaseHTTPServer.test( CORSRequestHandler, BaseHTTPServer.HTTPServer )
subject: Add python3 support to stop Steve whinging