簡體   English   中英

為什么我在此代碼的第一行出現語法錯誤?

[英]Why am I getting a syntax error on the first line of this code?

我無法理解語法錯誤是什么。

application(environ,start_response):
    status = '200 OK'
    html = '<html>\n' \
           '<body>\n' \
           ' Hooray, mod_wsgi is working\n' \
           '</body>\n' \
           '</html>\n'
    response_header = [('Content-type','text/html')]
    start_response(status,response_header)
    return [html]
  File "test_wsgi_script.py", line 1    application(environ,start_response):
                                       ^
SyntaxError: invalid syntax
(scripts) root@django:/var/www/scripts#

在 function 調用之前需要 def 嗎?

def application(environ,start_response):

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM