Python with CGI and WEB

0

I made a simple python code that displays a version of the user's operating system on a web page and configured my web server running on linux to be compatible with CGI. My webserver runs on a Windows machine.

    import cgi, cgitb 
    import platform

    form = cgi.FieldStorage() 
    print "Content-type:text/html\r\n\r\n"
    print "<html>"
    print "<head>"

    plataforma = platform.system()
    versao = platform.release()
    sistema= plataforma+" "+versao

    print "<h2>Seu sistema operacional e %s</h2>" % (sistema)
    print "</head>"
    print "<body>"
    print "</body>"
    print "</html>" 

It's quite simple just to understand the CGI's operation with python, but when I open this page on a Linux machine for example, it gives me the message that I use the windows version of my Web Server.

My question is, does CGI run on the server and not on the client? For example, a python code in the same style that downloads a file, would it download to the server and not to the client? Is there any other way to make CGI run locally or would it have to use another methodology?

    
asked by anonymous 01.11.2017 / 13:15

0 answers