"print >> file" ok. What about "print > file" to truncate?

Bengt Richter bokr at accessone.com
Sun Sep 3 22:14:18 CEST 2000


IANAPP (I Am Not A Python Programmer), but truncating a file
to zero length before writing can be useful. ">>" seems to
mean "append" implicitly, so why not borrow the other redirection
symbol? (No doubt you can accomplish this other ways, but not as
concisely?)

Just my 2 cent reaction, on seeing a python news article at

http://www.oreillynet.com/pub/a/python/2000/08/30/pythonnews.html

as I was randomly surfing thereabouts.




More information about the Python-list mailing list