Question using CGI in Python

Markus Schaber markus at
Wed Aug 29 21:30:46 CEST 2001


Maan Hamze <mmhamze at> schrub:

> Hidden = '<input type=hidden name=AnyNameHere value='+str(VAR1)+'>'

Yes, that works, but the Solution from Ignacio Vazquez-Abrams

>> print '<input type="hidden" name="VAR1" value="%s">' % VAR1

Should be faster, especially when using lots of pluses, as the plus 
operator generates an string at every addition that is just for the GC.

"The strength of the Constitution lies entirely in the determination of 
each citizen to defend it. Only if every single citizen feels duty 
bound to do his share in this defense are the constitutional rights 
secure." -- Albert Einstein

More information about the Python-list mailing list