An Interest In:
Web News this Week
- March 22, 2024
- March 21, 2024
- March 20, 2024
- March 19, 2024
- March 18, 2024
- March 17, 2024
- March 16, 2024
March 20, 2022 10:37 pm GMT
Original Link: https://dev.to/waylonwalker/how-i-read-files-in-python-3e14
How I read Files in Python
When I need to read contents from a plain text file in python I find the easiest way is to just use Pathlib
.
from pathlib import PathPath('path_to_file').read_text()
Original Link: https://dev.to/waylonwalker/how-i-read-files-in-python-3e14
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To