我有
def id_generator(size=6, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for x in range(size))
r = id_generator()
bat = open('MS-%s.bat',"w")%(r)
为什么这不起作用?
TypeError: unsupported operand type(s) for %: 'file' and 'str'