简体   繁体   English

ValueError:定义字典中不支持的格式字符'{'(0x7b)

[英]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.

相关问题 ValueError:索引处不支持的格式字符'{'(0x7b) - ValueError: unsupported format character '{' (0x7b) at index ValueError: 不支持的格式字符 '{' (0x7b) at index 40 - Python & CURL - ValueError: unsupported format character '{' (0x7b) at index 40 - Python & CURL ValueError: 不支持的格式字符 ']' (0x5d) - ValueError: unsupported format character ']' (0x5d) Python3:ValueError:索引 568 处不支持的格式字符“B”(0x42) - Python3: ValueError: unsupported format character 'B' (0x42) at index 568 ValueError: 不支持的格式字符 ';' (0x3b) 在索引 946 HTML 电子邮件与熊猫数据框 - ValueError: unsupported format character ';' (0x3b) at index 946 HTML email with pandas dataframe ValueError:不支持的格式字符' - ValueError: unsupported format character ' Python,Django:ValueError:索引3处不受支持的格式字符'('(0x28) - Python, Django: ValueError: unsupported format character '(' (0x28) at index 3 ValueError:索引79处不支持的格式字符'a'(0x61) - ValueError: unsupported format character 'a' (0x61) at index 79 ValueError:不支持的格式字符'C'(0x43) - ValueError: unsupported format character 'C' (0x43) Python:ValueError:索引1处不支持的格式字符'''(0x27) - Python: ValueError: unsupported format character ''' (0x27) at index 1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM