Thanks for you reply and Help Fredrik Lundh The change did remove the error message, and I can see what was wrong. However there is now a new problem, the only thing that is displayed is one single character and that is: <
Do you or anyone else have a suggestion to what the cause to this new problem is ? Thanks for your time "Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hansan wrote: > >> I used the same code they use for making the two display functions and >> the >> same template for the html form. I even tried using the form template >> they >> use too, but it still dosnt work. I will now show how the functions and >> templates look like. >> >> The two display functions are: >> def Display(Content): >> TemplateHandle = open(TemplateFile, "r") >> TemplateInput = TemplateHandle.read() >> TemplateHandle.close() >> BadTemplateException = "There was a problem with the HTML template." >> SubResult = re.subn("<!-- *** INSERT CONTENT HERE *** -->", >> Content,TemplateInput) > > re.subn takes a regular expression, in which certain characters have > special meanings. for example, in > > <!-- *** INSERT JWZ QUOTE HERE *** --> > > "*" is reserved character, which means "repeat preceeding expression". > > so "***" means repeating a repeated repeat, which makes very little > sense, which is why the RE engine complains. > > changing > >> SubResult = re.subn("<!-- *** INSERT CONTENT HERE *** -->", >> Content,TemplateInput) > > SubResult = TemplateInput.replace( > "<!-- *** INSERT CONTENT HERE *** -->", > Content > ) > > should work better. > > </F> > > > -- http://mail.python.org/mailman/listinfo/python-list