The most simple report is to generate some text and store it in a file.
Creating a simple report in plain text
Getting ready
For this recipe, we will generate a brief report in text format. The data to be stored will be in a dictionary.
How to do it...
- Import datetime:
>>> from datetime import datetime
- Create the template with the report in text format:
>>> TEMPLATE = '''
Movies report
-------------
Date: {date}
Movies seen in the last 30 days: {num_movies}
Total minutes: {total_minutes}
'''
- Create a dictionary with the values...