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).
In this article, I describe the process I used to create a home automation system using off-the-shelf products, Python and Linux. I start by describing the Serial I/O Kit, drive alert, water alarm, ...