openjoel
December 29th, 2008, 04:29 PM
So I'm new to python and this is my first little bigger application,
I'm trying to do some basic templating stuff and then sending it with cherrypy.
file = open("templates/index.html", 'r').read()
return file
this will print the html code in the browser.
Now the thing I want to do is replace $$title$$ with another value defined in the python file.
But I do not want it to be permanent, if you get what I mean.
I just want the variable file to contain the edited version.
Now how do I do that?
I'm trying to do some basic templating stuff and then sending it with cherrypy.
file = open("templates/index.html", 'r').read()
return file
this will print the html code in the browser.
Now the thing I want to do is replace $$title$$ with another value defined in the python file.
But I do not want it to be permanent, if you get what I mean.
I just want the variable file to contain the edited version.
Now how do I do that?