File Iterator - Print - Double New Lines

Mike Brenner mikeb at mitre.org
Sat Jun 1 14:37:46 EDT 2002


print "QUESTION: Why did it jump from NO LINE SPACING to DOUBLE SPACING?"
print "QUESTION: How to get SINGLE SPACING?"
print
print "Using Python 2.2.1, it does the same under win32all build 142 and "
print "      running it from a DOS box without the windows extensions."

def writer(list):
    f=open("tmp.tmp","w")
    for item in list:
        f.write(item)
    f.close()

def reader():
    f=open("tmp.tmp","r")
    for line in f:
        print line
    f.close()

print "trying it without the \\n"
writer(["a","b","c"])
reader()

print "trying it with the \\n"
writer(["a\n","b\n","c\n"])
reader()






More information about the Python-list mailing list