0

I am new to Python and want to extract integers from an csv file and if they meet certain parameters I want my program to execute an update 'H' or 'T'. My question is how do I import the values from my csv file into this for loop?

def main():
    suite = Euro(range(0, 101))
    for i in range(0, 32):
        suite.Update('H')
    for i in range(0, 9):
        suite.Update('T')

Edit: The input csv file looks like below.

Cheq1, Cheq2      
113, 130
105, 138
0, 128
142, 142
96, 137
kvax12v
  • 179
  • 1
  • 1
  • 7

1 Answers1

0
import csv
with open('file.csv', 'rb') as f:
    reader = csv.reader(f)
    your_list = list(reader)
print your_list
# [['Cheq1', 'Cheq2'],
#  ['113', '130'],
#  ['0', '128']]
# ...

You should be able to handle it from there.

Kyle Baker
  • 3,424
  • 2
  • 23
  • 33