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).
Need help choosing the best Python ORM for your projects? Here's what you need to know about SQLAlchemy, PonyORM, Django ORM, Peewee, SQLObject, and Tortoise ORM. When you want to work with a ...