1 point by kas 8 months, 2 weeks ago | 1 comment | on: How to Read a File in Python, Write to, plus Append, to a File
In an article that talks about handling files, I feel that `pathlib` should have been mentioned: import pathlib path = pathlib.Path('/path/to/file') with path.open('w') as fptr: print('oh, hai!', file=fptr) (I wonder if identing the block above renders the block as a code block…)


 
1 point by kas 8 months, 2 weeks ago | discuss | parent | on: How to Read a File in Python, Write to, plus Append, to a File
(It didn't, damn!)