Getting python to work, Internal Server Error

后端 未结 12 1559
無奈伤痛
無奈伤痛 2021-02-08 11:07

I\'m trying to get Python scripts, called from a web browser, to work. I keep getting the error:

500 Internal Server Error

When I check my err

12条回答
  •  遇见更好的自我
    2021-02-08 11:42

    One common error is the wrong path. I my case it was usr/bin/python. The other common error is not transferring the file in ASCII mode. I am using WinSCP where you can set it easily: Go to Options->Preferences->Transfers->click Edit and change the mode to Text.

    This code should work:

    #!/usr/bin/python
    print "Content-type: text/html\n\n";
    print "";
    print "CGI Test";
    print "";
    print "

    Test page using Python

    "; print "";

提交回复
热议问题