What's the difference? w and w+ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What's the difference? w and w+

What's the significance with w+ though. Examples, explanations please.. I know that w+ will read the file but wouldn't the file get truncated? And if reading will come first, what could be the sense— will the contents get saved or smthng, would the user be able to read the contents too or just the program —it would still get truncated And anyway, is there a way to write on the file without it getting truncated? (not through append)

14th Jun 2022, 1:26 AM
bjakmz
bjakmz - avatar
1 Answer
0
Maybe this has what you want https://docs.python.org/3/library/functions.html#open
14th Jun 2022, 4:50 AM
Ipang