python-style-guide
python-style-guide copied to clipboard
Add working with files section
- [ ] Use absolute path not relative (
path.dirname(__file__)to reduce verbosity) - [ ] Always use with
- [ ] Avoid reading and writing at thew same time
- [ ] Use a Context Manager
- [ ] Check File Existence
- [ ] Handle File Open Modes
- [ ] Handle File Encoding
- [ ] Handle Exceptions
- [ ] Close Files Explicitly