powerapi-ng/pyJoules

csv handler giving IndexError: list index out of range

j-j-kam opened this issue · 1 comments

from pyJoules.energy_meter import measure_energy
from pyJoules.handler.csv_handler import CSVHandler

csv_handler = CSVHandler("./br_global_to_local2.csv")

global a, d
a = 5000
d = 3000


@measure_energy
def one():
    c = 4
    b = a * d * c
    return b


if __name__ == "__main__":

    for _ in range(10):
        one()

    csv_handler.save_data()

Stupid error. Don't forget to add the handler as parameter to @measure_energy