2023年8月23日 星期三

error message : configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: "%)']/following::android.widget.EditText"

 In general analysis, the last sentence is the key point: When reading the configuration file config.ini, there are % caused by

 

Solution one:

Most likely configparser is reading the literal "%" sign in the string. The '%' symbol is used for string interpolation (substitution). If you want to use a literal "%", you can escape it with another "%". For example, use "100%%" to mean "100%" in configuration variables read by configparser.

Solution two:

Change from

cf= configparser.ConfigParser()

to

cf = configparser.RawConfigParser()

沒有留言:

 Ubuntu has a mechanism, that is, the installed network card (NIC) will be renamed to another name when the system is booted. Although there...