0

I have a JSON code with variables in postman and used the runner collection to upload a csv file in order to substitute the code variables with their values.

Now, I'm trying to do the same but with python code.

I have generated the python code from Postman which included the variables. How can I upload the CSV file in Python in order to give the variables their values or is there another method that can work as the runner collection of postman but in python?

Maguy
  • 1

1 Answers1

0
f = open("1.csv", "r")
tmp= [i.split(",") for i in f]
print(tmp)
f.close()

tmp will have your csv so to get the first row use tmp[1] as tmp[0] will be headings . To get first column use . tmp[1][0]

PDHide
  • 18,113
  • 2
  • 31
  • 46