Raw Newbie: What's the "<?" tag and how can I learn more about it?

KEVIN ZEMBOWER KZEMBOWER at jhuccp.org
Wed Nov 13 13:10:22 EST 2002


Thank you, Alan, holger and Simon, for all your help.

The '%%' worked like a champ.

It never occurred to me that the author of ezmlm-browse would have written his own template system. Thank you for removing this source of frustration. Some of the files in the system are copyright Bruce Guenter, so I'll write to him with any further questions.

Thanks, again, for all your help.

-Kevin Zembower

>>> Alan Kennedy <alanmk at hotmail.com> 11/13/02 12:37PM >>>
KEVIN ZEMBOWER:

>> I've found templates which look like this:
>>     <? if body is None ?>
>>       <hr><strong>["%(type)s" not shown]</strong>
>>     <? else ?>
>>       <hr><table width="640">
>>       <tr><td>%(markup_urls(html(body)))s</td></tr>
>>       </table>
>>     <? end ?>
>>
>> Obviously, this is python code embedded in HTML, very similar to php in
>> HTML, with which I am more familiar. However, I can't find any
>> references to the "<?" tag system on the python.org web site.

As Simon mentioned already, that's because it's not part of core python,
it belongs to whatever template system ezmlm uses.

>> The specific problem I'm working on involves the line '<hr><table
>> width="640">'. I'd like to change the width to "100%", but the percent
>> sign must be interpreted as a special character. It causes strange
>> errors. I've tried escaping it with 'width="100\%"', but this doesn't
>> seem to work, either. Any help on this small problem?

I don't know for certain, but the "100%" may be being interpreted as a
python "format string". See these urls for information on format
strings.

http://www.python.org/doc/current/tut/node9.html 
http://sandbox.mc.edu/~bennet/python/code/io.html 

IFF it is a format string, then the solution is to double up the % sign:
i.e. express it like so "<table width='100%%'>".

However, if that isn't the problem, I don't have any further suggestions
to make.

regards,

-- 
alan kennedy
-----------------------------------------------------
check http headers here: http://xhaus.com/headers 
email alan:              http://xhaus.com/mailto/alan 
-- 
http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list