【问题标题】:Setting up apache for python为python设置apache
【发布时间】:2020-12-18 14:20:00
【问题描述】:

我目前正在尝试在 Windows 10 的虚拟机 (ubuntu) 上为 python 设置 apache。尝试在浏览器中执行脚本时遇到问题。有人可以帮忙吗?

这是我试图执行的脚本:

#!/usr/bin/python3

def application(environ, start_response):
    status='200 OK'
    html =  '<html>\n'   
    '<body>\n'           
    '<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">\n'           
    'Welcome to mod_wgsi Test Page\n'            
    '</div>\n'  
    '</body>\n'            
    '</html>\n'
    response_header = [('Content-type','text/html')]
    start_response (status, response_header)
    return [html]

这是错误日志的 sn-p:

提前致谢! :)

【问题讨论】:

    标签: python ubuntu virtual-machine


    【解决方案1】:

    尝试:

    html =  '''<html>
    <body>    
    <div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">         
    Welcome to mod_wgsi Test Page         
    </div>
    </body>          
    </html>'''
    

    【讨论】:

      猜你喜欢
      • 2010-10-01
      • 2010-11-08
      • 2012-06-30
      • 2013-01-02
      • 1970-01-01
      • 2012-03-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多