Simple Python CGI Server
Ein einfacher HTTP-Server mit CGI-Unterstützung in Python
- 2012-09-07T13:24:00+02:00
- 2022-02-15T15:42:34+02:00
- Kommentar schreiben
Eine Datei server.py mit folgendem Inhalt anlegen:
#!/usr/bin/env python
import BaseHTTPServer
import CGIHTTPServer
import cgitb; cgitb.enable() ## This line enables CGI error reporting
server = BaseHTTPServer.HTTPServer
handler = CGIHTTPServer.CGIHTTPRequestHandler
server_address = ("", 8080)
handler.cgi_directories = [""]
httpd = server(server_address, handler)
httpd.serve_forever()
Die Datei ausführbar machen und starten!