Getting python to work, Internal Server Error

后端 未结 12 1537
無奈伤痛
無奈伤痛 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:47

    I had a similar problem, the problem is that you need to have two lines breaks after printing the content type. The following worked for me :

    #!/usr/local/bin/python2.6
    print('Content-type: text/html\r\n')
    print('\r\n')
    print('Hello, World!')
    

提交回复
热议问题