上記の画像をpythonのCGIで表示させたいのですが、どうにもなりません。
フォルダ構成は以下のようになっています。
サーバを立ち上げて
http://localhost:8xxx/cgi-bin/image_out.py
にアクセスしたときに画像を表示させるためにはどうすればよいでしょうか?
image_out.pyの中身です。
python
1#! /usr/bin/env python3 2 3import cgi 4import cgitb 5cgitb.enable() 6 7f = open("src/syusyoku_nayamu_neet_man.png","rb") 8print("Content-Type: text/html") 9# print("Content-Type: image/jpeg") 10print("") 11 12print("<html><body>") 13print(f.read()) 14print(result) 15print("</body><html>")
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/04/30 06:31
2019/04/30 07:39
2019/04/30 08:52
2019/04/30 08:56
2019/04/30 09:19