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.

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

1 Comment

THIS IS IT - THANK YOU!!!!! Waiting the 10 min so I can make sure I mark this as the answer :)
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

1 Comment

a better explanation is here: stackoverflow.com/questions/18533621/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.