Skip to content

Commit 3129d72

Browse files
authored
Merge pull request #130 from FlashEb/Issue-#127-Fix
Issue #127 fix
2 parents 3187210 + ef20757 commit 3129d72

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

source/ch8_filehandling.ptx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,15 @@
122122
<program xml:id="creat-file-exp-2" interactive="activecode" language="python">
123123
<code>
124124
filename = "newfile.txt"
125-
print(f"Attempting to write to '{filename}' using 'w' mode...")
125+
print("Attempting to write to '" + filename + "' using 'w' mode...")
126126
try:
127127
with open(filename, 'w') as f:
128128
f.write("This file was created using 'w' mode.")
129-
print(f"SUCCESS: The file '{filename}' was created or overwritten.")
129+
print("SUCCESS: The file '" + filename + "' was created or overwritten.")
130130
except Exception as e:
131131
# This would only catch other unexpected errors
132-
print(f"An unexpected error occurred during write: {e}")
132+
print("An unexpected error occurred during write: " + str(e))
133+
133134
</code>
134135
</program>
135136

0 commit comments

Comments
 (0)