Note that there is an important difference between 'r+' and 'w+': the latter will truncate the file, while the former will not.
- 11. Files and Stuff
- from Beginning Python: From Novice to Professional, 3rd Edition
- Publisher: Apress
- Released: March 2017
'w+' will truncate the file
Share this highlighthttp://www.safaribooksonline.com/a/beginning-python-from/12282069/