您需要将格式参数放入元组(添加括号):
instr = "'%s', '%s', '%d', '%s', '%s', '%s', '%s'" % (softname, procversion, int(percent), exe, description, company, procurl)
您当前拥有的等同于以下内容:
intstr = ("'%s', '%s', '%d', '%s', '%s', '%s', '%s'" % softname), procversion, int(percent), exe, description, company, procurl
例:
>>> "%s %s" % 'hello', 'world'
Traceback (most recent call last):
File "", line 1, in
TypeError: not enough arguments for format string
>>> "%s %s" % ('hello', 'world')
'hello world'