print "hello", >> file

Hilbert hilbert at microsoft.com
Fri Feb 28 17:05:19 CET 2003


Thanks for correcting my syntax problem!

Hilbert

"Alex Martelli" <aleax at aleax.it> wrote in message
news:QdG6a.311408$AA2.11811145 at news2.tin.it...
> Hilbert wrote:
>
> > Hello,
> >
> > Why does the following result in an error?
> >
> > f = file("welcome.txt","w")
> > print "hello", >> f
>
> Because the "print>>BAH" syntax is all wacko.  You
> need to code:
>     print >> f, "hello"
>
>
> Alex
>






More information about the Python-list mailing list