how to display an HTML <img scr> tag using Python...

Peter Hansen peter at engcorp.com
Tue Feb 11 12:51:55 EST 2003


Jay wrote:
> 
> Sorry about this newbie question...but
> 
> how do you display an HTML <img src="name"> tag using only Python (for
> CGI), I'm sure that you need to use some library, but can anyone tell
> me which one?
> 
> Also while in the same subject, can anyone also tell me how you can do
> a <a href="URL"></a> HTML hyperlink using just Python.
> 
> I'm trying to mix using both Python and HTML.

If you really mean you are using CGI, and I almost have to assume you
actually have something working already that can generate HTML (or
you would have been asking a more general question), then you 
would just generate those HTML tags using the same "print" 
statements you are already using to generate the other output.

Maybe you're missing something in the question... do you have
a program already working?  Maybe posting a small snippet from
it, or an example of what you've already tried to get this working,
would be of assistance.

-Peter




More information about the Python-list mailing list