Hi; I have the following Python Script (*not* External Script): import string size = string.atoi(size)/1280 css = "<style type='text/css'>" css += ".headline { position: absolute; top: " + str(100*size) + "; left: " + str(150*size) + "; font-style: 800 " + str(40*size) + "px futura }" css += ".belowHeadline { position: absolute; top: " + str(150*size) + "; left: " + str(250*size) + "; font-style: italic " + str(25*size) + "px verdana }" css += "</style>" return css It isn't rendering properly because the brackets are being translated into ASCII. How do I prevent this? TIA, beno
beno schrieb:
Hi; I have the following Python Script (*not* External Script):
import string
size = string.atoi(size)/1280 css = "<style type='text/css'>" css += ".headline { position: absolute; top: " + str(100*size) + "; left: " + str(150*size) + "; font-style: 800 " + str(40*size) + "px futura }" css += ".belowHeadline { position: absolute; top: " + str(150*size) + "; left: " + str(250*size) + "; font-style: italic " + str(25*size) + "px verdana }" css += "</style>"
Try: print css return printed
return css
It isn't rendering properly because the brackets are being translated into ASCII. How do I prevent this? TIA, beno
Martin
At 07:57 PM 10/10/2002 +0200, you wrote:
beno schrieb:
Hi; I have the following Python Script (*not* External Script):
import string
size = string.atoi(size)/1280 css = "<style type='text/css'>" css += ".headline { position: absolute; top: " + str(100*size) + "; left: " + str(150*size) + "; font-style: 800 " + str(40*size) + "px futura }" css += ".belowHeadline { position: absolute; top: " + str(150*size) + "; left: " + str(250*size) + "; font-style: italic " + str(25*size) + "px verdana }" css += "</style>"
Try:
print css return printed
Nope. Try again? TIA, beno
beno wrote:
Hi; I have the following Python Script (*not* External Script):
import string
size = string.atoi(size)/1280 css = "<style type='text/css'>" css += ".headline { position: absolute; top: " + str(100*size) + "; left: " + str(150*size) + "; font-style: 800 " + str(40*size) + "px futura }" css += ".belowHeadline { position: absolute; top: " + str(150*size) + "; left: " + str(250*size) + "; font-style: italic " + str(25*size) + "px verdana }" css += "</style>" return css
It isn't rendering properly because the brackets are being translated into ASCII. How do I prevent this? TIA, beno
don't know what you mean... what does "translated into ASCII" mean in this context? works for me without problems... -- Maik Jablonski __o www.zfl.uni-bielefeld.de _ \<_ Deutsche Zope User Group Bielefeld, Germany (_)/(_) www.dzug.org
At 08:30 PM 10/10/2002 +0200, you wrote:
beno wrote:
Hi; I have the following Python Script (*not* External Script): import string size = string.atoi(size)/1280 css = "<style type='text/css'>" css += ".headline { position: absolute; top: " + str(100*size) + "; left: " + str(150*size) + "; font-style: 800 " + str(40*size) + "px futura }" css += ".belowHeadline { position: absolute; top: " + str(150*size) + "; left: " + str(250*size) + "; font-style: italic " + str(25*size) + "px verdana }" css += "</style>" return css
It isn't rendering properly because the brackets are being translated into ASCII. How do I prevent this? TIA, beno
don't know what you mean... what does "translated into ASCII" mean in this context?
< is rendered as > and I don't want it rendered as such! How do I prevent these characters from being interpreted? TIA, beno
beno wrote:
< is rendered as >
Your Script isn't doing this. I presume you're calling the Script from a Page Template, using tal:replace or tal:content? If so, you need to use the 'structure' keyword to prevent escaping, like this: tal:replace="structure here/myScript" Cheers, Evan @ 4-am
At 01:49 PM 10/10/2002 -0500, you wrote:
beno wrote:
< is rendered as >
Your Script isn't doing this. I presume you're calling the Script from a Page Template, using tal:replace or tal:content? If so, you need to use the 'structure' keyword to prevent escaping, like this:
tal:replace="structure here/myScript"
Ah, so *that's* what structure is used for! Thanks again, Evan. (BTW, do you ever tire of answering questions of neophytes like me? How many years has it been...?) beno
participants (4)
-
beno -
Evan Simpson -
Maik Jablonski -
Martin Gebert