25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

16 lines
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()