I am writing code for web development using the Google Python Appengine. In my code, I have to concatenate strings using% and a dictionary. Here is the code I wrote.
def print_form(self, unameError='', passwdError='', verpasswdError='', emailError='', unameValue='', emailValue='' ): self.response.out.write( form3 % { "unameError" : unameError, "passwdError" : passwdError, "verpasswdError": verpasswdError, "emailError" : emailError, "unameValue" : unameValue, "emailValue" : emailValue } )
For this code, I get this error from the server:
web-app-local-directory-path / main.py ", line 139, in print_form" emailValue ": emailValue ValueError: unsupported format character '{' (0x7b) at index 218
I canβt understand what is wrong with this code. I have defined a valid dictionary and it seems I have no problem with it.
Someone please help me with this.
Relationship Wid, Abhishek
source share