insert row into a website address

时间:2017-04-10 02:21:28

标签: python python-2.7

here is what I have so far, not much but I am learning

import csv

f = open('in.csv')

csv_f = csv.reader(f)

for row in csv_f:
    print row[1]

The csv file is like so

data1, data2
data3, data4
data5, data6
and so on

I need to take row1 and insert it to a website address

www.mysite.com/data2

www.mysite.com/data4

www.mysite.com/data6

it will always be row 1 that will be used

next will be to capture the website output and put it into a output.csv if the value is over 0

www.mysite.com/data2 website says 0
www.mysite.com/data4 website says 0.000345
www.mysite.com/data6 website says 1.34938

outout.csv once opened would look like

data4, 0.000345
data6, 1.34938

If I run the program again with a new in.csv and a value over 0 is found just add it to the existing output.csv file

0 个答案:

没有答案