Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

16 rader
617 B

  1. from http.server import CGIHTTPRequestHandler, HTTPServer
  2. # Port sur lequel le serveur écoutera
  3. PORT = 8888
  4. class CustomCGIHandler(CGIHTTPRequestHandler):
  5. cgi_directories = ['./localhost/cgi-bin','/localhost/cgi-bin','./localhost/cgi-bin','/cgi-bin', '/notebooks/mushroom_observer/localhost/cgi-bin'] # Chemin du répertoire CGI
  6. def run(server_class=HTTPServer, handler_class=CustomCGIHandler, port=PORT):
  7. server_address = ('', port)
  8. httpd = server_class(server_address, handler_class)
  9. print(f'Serveur démarré sur le port {port}')
  10. httpd.serve_forever()
  11. if __name__ == "__main__":
  12. run()