犯罪嫌疑人X
f.write("xx\nxx")不就行了么……如果觉得难看还可以# for py3k or `from __future__ import print_function`
print("xxx", file=fileobject)
# for py2.x without print_function
print >> fileobject, "xxx"