. Advertisement .
..3..
. Advertisement .
..4..
I’m building a new program, but when I run it, an error pops up. The error displayed is as follows:
TypeError: not enough arguments for format string
I have tried several workarounds, but they still do not get the desired results. If you have come across this situation and have a solution for the “typeerror: not enough arguments for format string” problem, pls let me know. Here is what I do:
instr = "'%s', '%s', '%d', '%s', '%s', '%s', '%s'" % softname, procversion, int(percent), exe, description, company, procurl
Thanks!
The cause: This error happens because the
%
syntax to format strings is getting obsolete.Solution: You should use it if your Python version supports it. This will also fix the error you made.
Format arguments must be converted to a tuple (add brackets)
The current situation is the same as the following:
Example: