Webserver (such as apache) enables python parsing (such as cgi). Please refer to relevant manuals and tutorials for this
Write #python parser path in the first line of the script
The script is output as print html code
Give the directory where the script is stored and the script itself permission to run
Then http://.../script path can be accessed
If you want to output to the terminal, just like this:
If you want to write to a file, you first piece together the string of the web page as above, and then write it to the
.html
file.Webserver (such as apache) enables python parsing (such as cgi). Please refer to relevant manuals and tutorials for this
Write #python parser path in the first line of the script
The script is output as print html code
Give the directory where the script is stored and the script itself permission to run
Then http://.../script path can be accessed