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

Jay jranchordas at hotmail.com
Wed Feb 12 07:23:57 EST 2003


Peter Hansen <peter at engcorp.com> wrote in message news:<3E49383B.9CBB732E at engcorp.com>...
> 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


Right...

using 

print '<html tags here>' 

you can use html tags that can be displayed on screen.  But when using
print '<img src"file.jpg">' 

doesn't work..I'm guessing it's something to do with the quotes,
right?  Are they any ways to tell Python to read in the whole tag,
ignoring quotes inside them???

Sorry about being too ambigous, I'm new at this groups thing..




More information about the Python-list mailing list