How do I create a new file?

Joshua Macy amused at webamused.com
Wed Feb 2 03:26:44 CET 2000


bovinesoft at my-deja.com wrote:
> 
> What code would I use if I wanted to create a new file in python?  If
> you could help me with this, I would be greatly appreciative.  Thanks
> again.
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.


f = open('test', 'w')

will open the file test for writing.

  Joshua



More information about the Python-list mailing list