Page 1 of 1

Python: Creating a New File

Posted: Thu Apr 16, 2026 6:48 pm
by 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.