0

All I want to do is create a file (doesn't matter the extension) in a windows directory using Python.

I cannot find any reference to this specific function anywhere currently.

Yogwhatup
  • 352
  • 1
  • 3
  • 18

2 Answers2

1

You would use write() for this, using a file name that you haven't used before.

http://www.tutorialspoint.com/python/file_write.htm

Chris
  • 33
  • 8
  • a better explanation is here: http://stackoverflow.com/questions/18533621/creating-a-new-text-file-with-python – Chris Mar 10 '16 at 20:20
1

open(filename, "w") might be what you're looking for. The "w" argument means write and will create that file if it doesnt already exist. If it does exist, it will overwrite the contents if written to. Python I/O Documentation

Russley Shaw
  • 441
  • 2
  • 9