Page 1 of 1

Python: Creating a New Empty File

Posted: Wed Aug 20, 2025 12:04 pm
by The Jason

Code: Select all

with open("school_averages.txt", "x") as school_averages_dot_txt

# Creates a new file, but an error raised if one already exists with same name.