I have a python file that communicates with a device and access its parameters. As I have to access more than 100 parameters, I have stored those parameter names into one column in csv file. I want to access values assigned to these parameters. But what I am getting the parameters names instead of its values.
My csv file is like
parameter1
parameter2
parameter3
parameter4
...
I am using the following code:
import csv
TagList = []
with open('parameters.csv', 'rb') as file:
reader = csv.reader(file)
for row in reader:
TagList.append(row[0])
for tag in TagList:
print tag
Output:
parameter1
parameter2
parameter3
parameter4
...
What I want to access is the data assigned to these parameters. I can access its value through its name. i.e.
print parameter1
output: 1.0
I have tried print "%d" %(tag), that is also not working.
Please help me in that. Thanks in advance.