Chances are that you're running an old Python version, and not 3.1. In Python 2.6, you need indices in the format specs, like this:
"{0} {1}\n".format(x,y)
Update your Python version to a recent one, preferably 2.7 or 3.2, to fix the problem. According to the documentation, leaving out the numeric indices should work in Python 3.1:
Changed in version 3.1: The positional argument specifiers can be omitted, so '{} {}' is equivalent to '{0} {1}'.