Je suis débutant et je ne sais pas où je fais erreur. J'ai vu ces postes de pile Return an image to the browser in python, cgi-bin, Return Image from python CGI using javascript et How to loading/show a picture in a Python CGI page mais n'a obtenu aucune aide.Comment afficher l'image en Python-CGI
Voici le code:
#!C:\Python27\python
text = """Content-type: text/html\n
<TITLE> CGI 101 </TITLE>
<H1>A SECOND CGI SCRIPT </H1>
<HR>
<P> HELLO,CGI WORLD!</P>
<img src="../imag000.jpg" width=101 height=64 border=0 alt="">
<HR>
"""
print (text)
et sur le navigateur, il apparaît petite boîte qui ne montre pas l'image, comme ceci:
Veuillez aider.
et le dossier qui contient l'image est cgi. Veuillez voir l'image:
Le type mime de vos données n'est pas l'image/png mais text/html. Si vous changez cela, à condition que vous ayez l'image à l'endroit que vous spécifiez, elle devrait apparaître. –
, mais l'image ne vient pas – user3440716
ici est ma mise à jour: # C: \ Python27 \ python text = "" "Content-Type: text/html \ n
SECONDE CGI SCRIPT
BONJOUR, CGI WORLD
"" » impression (texte) – user3440716