无法使用mod_python来在网页中加载图片

| 我必须使用mod_python制作网页,我必须在网页上加载图片,这是我编写的代码
import cgi
import nltk
import time

    def fill():
       s = \"\"\"\\
    <html><body bgcolor=\"777777\" >
    <form method=\"get\" action=\"./show\">
    <p>Type a word: <input type=\"text\" name=\"word\">
    <input type=\"submit\" value=\"Submit\"</p>
    </form>
    <img width=\"640\" height=\"480\" src=\"simplify.jpg\" />
    </table>
    </body></html>
    \"\"\"
       return s
它必须加载图像,但是不能加载..什么问题?我找不到任何好的教程,如果有人可以建议我提供链接,那将非常有帮助。     
已邀请:
我猜你使用apache2 mod python。必须有一个称为def index的函数,该函数至少接收一个参数即请求。该功能的结果将传递给客户端。 因此,在您的情况下,例如:
def index (req):
       s = \"\"\"\\
    <html><body bgcolor=\"777777\" >
    <form method=\"get\" action=\"./show\">
    <p>Type a word: <input type=\"text\" name=\"word\">
    <input type=\"submit\" value=\"Submit\"</p>
    </form>
    <table height=\"200\" width=\"300\"
     background=\"/var/www/cgi-bin/simplify.jpg\" >
    <img width=\"640\" height=\"480\" src=\"simplify.jpg\" />
    </table>
    </body></html>
    \"\"\"
       return s
    

要回复问题请先登录注册