Answer the question
In order to leave comments, you need to log in
When running a .py file via CGI, does it knock out all the code in the file?
Everything was done here . But I'm getting all the code. I ran the file through the terminal, indicated the full path to python.exe. But all the same in the browser knocks out
#!C:\Users\Andrey\AppData\Local\Programs\Python\Python310\python.exe
print("Content-type: text/html")
print()
print("<h1>Hello world!</h1>")
Answer the question
In order to leave comments, you need to log in
According to the documentation :
The do_GET() and do_HEAD() functions are modified to run CGI scripts and serve the output, instead of serving files, if the request leads to somewhere below the cgi_directories path.
cgi_directories
This defaults to ['/cgi-bin', '/htbin'] and describes directories to treat as containing CGI scripts.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question