On 2010-12-29 10:54, Tommy Kaas wrote: > It works fine but besides # I also get spaces between the columns in the > text file. How do I avoid that? You could use the new print-function and the sep keyword argument, e.g.: from __future__ import print_function f = open("filename", "w") print("1", "2", "3", file=f, sep="")