Web programming / print - exec problem !?
Florent Ramière
framiere at netcom-service.com
Tue Feb 15 14:20:25 EST 2000
Hello,
it seems that print in exec statements is not unbeffered !?
Here is the description of the problem
Here is my template: python is embeded in html code
<---------------
<TR>
<TD <%% print 'class="%s"' % strListClass, %%>>
<%%
strValue = netMine.tools.CDBTools.GetFromRowAndName(self.pCursor,
pRow,'COUNTRY_ID')
strEvaluated = strValue
if (strEvaluated == None):
{
print " "
}
else:
{
print netMine.tools.CDBTools.TextToHTML(strEvaluated)
}
%%>
</TD>
------------->
I have written a parser to make the code python compliant ;)
<---------------------
print "<TR>\n"
print "<TD "
print 'class="%s"' % strListClass,
print ">\n",
strValue = netMine.tools.CDBTools.GetFromRowAndName(self.pCursor,
pRow,'COUNTRY_ID')
strEvaluated = strValue
if (strEvaluated == None):
print " "
else:
print netMine.tools.CDBTools.TextToHTML(strEvaluated)
print " </TD>\n",
--------------------->
And i must exec this string in order to print my web page, well, it is
not great because of the buffered print !
The method workds perfectly, but is too low because of the print !
Help me make this stuff unbeffered ! :-)
I can send you my PHTML parser if you want of course !
Florent.
---------
Florent Ramière framiere at netcom-service.com
Netcom http://www.netcom-service.com
15, rue de Rémusat - 75016 Paris
Tel : 06-60-61-85-32 --- Fax : 01-42-30-50-55
More information about the Python-list
mailing list