Generate dynamic CSV using script

It looks to me like that dataset is unnecessary…i would use the python csv library…

import csv

ofile = open(FilePath, 'a')  # open the file in append mode
writer = csv.writer(ofile, delimiter=',', lineterminator='\n')
writer.writerows(Data)  # write the list of lists all at once
# writer.writerow(olist) to append just one row to the csv file
ofile.close()  # make sure to close your file!

also, rather than appending over and over again, I would do something like this in each block of code:

Data = []

Data += [
    [“File Name”,FileName,"","",""]
    ,[“Date”,Date,"","",""]
    ,[“Time”,Time,"","",""]
]

not super sure what that 1.440000… thing is, but you might try using python’s

round(1.44000005722, 3)
2 Likes