[英]ValueError: unsupported format character '{' (0x7b) in defining dictionary
I'm writing some code for web development using Google Python Appengine. 我正在使用Google Python Appengine为Web开发编写一些代码。 In my code I have to concatenate strings using % and dictionary Here's the code I've written.
在我的代码中,我必须使用%和字典连接字符串这是我编写的代码。
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'm receiving this error from server : 对于此代码,我从服务器收到此错误:
web-app-local-directory-path/main.py", line 139, in print_form "emailValue" : emailValue ValueError: unsupported format character '{' (0x7b) at index 218
在print_form“emailValue”中的web-app-local-directory-path / main.py“,第139行:emailValue ValueError:索引218处不支持的格式字符'{'(0x7b)
I can't seem to figure out what is wrong in this code. 我似乎无法弄清楚这段代码中有什么问题。 I've defined a valid dictionary and there seem to be no problem with it according to me.
我已经定义了一个有效的字典,根据我的说法似乎没有问题。
Somebody please help me on this. 有人请帮帮我。
Regards Vaid, Abhishek 关心Vaid,Abhishek
听起来你可能在form3
的值中有序列“%{”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.