Project Description
Your task for this project is to create a Python script that stores various system metrics any time it is executed.
How the Project Works
(1) The program should make use of the psutil library to store various computer metrics in a CSV file. Here is what the CSV file should look like:
(2) When the script is executed for the first time it creates a CSV file, adds a header (i.e., timestamp, cpu_usage, etc.), measures the metrics, and adds those metrics as a row of data in the CSV. (3) When the script is executed for the second time, it adds a new row with data in the existing CSV file. (4) Any time the script is executed, a new row with data is stored. (5) Optionally, upload the script to a service such as PythonAnywhere.com to schedule it for execution at a certain time every day.
Prerequisites
Required Libraries: psutil
Required Files: No files are required.
IDE: You can use any IDE on your computer to code the project.
Danger Zone
Here is an example of how to use psutil:
Here is the code solution:
Thanks for sharing.