I would like to write this to a file f.write("add unit at-wc 0 0 0 %s" % x ,y, z, "0.000 0.000 0.000 ") but when I do that I get an error saying function takes exactly 1 argument (4 given).
I would like to write this to a file f.write(add unit at-wc 0 0
Share
You’re using the
%operator incorrectly. You might be looking for something like this:Notice that the substitution variables
x, y, zare all in parentheses, which means they are a single tuple passed to the%operator.In your code, notice how you have four parameters to the
write()function (I’ve put each parameter on a separate line to make it easier to see):