print "hello", >> file

Gerhard Häring gerhard.haering at opus-gmbh.net
Tue Feb 25 10:43:44 CET 2003


Yar3k <programisci_listy at murator.org_zmien_na_com.pl> wrote:
> Alex Martelli <aleax at aleax.it> wrote:
>>    print >> f, "hello"
> 
> why not f.write("hello") ?

You mean f.write("hello\n")

The difference is that print automatically adds a newline char.

-- Gerhard




More information about the Python-list mailing list