[Tutor] scraping and saving in file

Patrick Sabin patrick.just4fun at gmail.com
Thu Dec 30 10:41:06 CET 2010


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="")



More information about the Tutor mailing list