Ask Question
instr = “’%s’, ‘%s’, ‘%d’, ‘%s’, ‘%s’, ‘%s’, ‘%s’” % softname, procversion, int(percent), exe, description, company, procurl
TypeError: not enough arguments for format string
改正:
instr = “’%s’, ‘%s’, ‘%d’, ‘%s’, ‘%s’, ‘%s’, ‘%s’” % (softname, procversion, int(percent), exe, description, company, procurl)
然而
Note that the % syntax for formatting strings is becoming outdated. If your version of Python supports it, you should write:
instr = “’{0}’, ‘{1}’, ‘{2}’, ‘{3}’, ‘{4}’, ‘{5}’, ‘{6}’”.format(softname, procversion, int(percent), exe, description, company, procurl)
This also fixes the error that you happened to have.