os.path.join (folder, filename) ensures the path is correct for the system. On Windows, it uses backslashes (reports\summary.txt); on Linux and macOS it uses forward slashes (reports/summary.txt).
We independently review everything we recommend. When you buy through our links, we may earn a commission. Learn more› By Melanie Pinola and Wirecutter Staff A notebook is more than just a practical ...