How to creat a file?

Wolfram Kraus kraus at hagen-partner.de
Fri Dec 2 08:02:29 EST 2005


sandorf wrote:
> I'm new to python. Have a simple question.
> 
> "open" function can only open an existing file and raise a IOerror when
> the given file does not exist. How can I creat a new file then?
> 
open the new file in write mode: open('foo', 'w')
See: help(open)

HTH,
Wolfram



More information about the Python-list mailing list