Всем привет, написала вот такой код: не получается в нем разделить элементы списка друг на друга и записать в файл
import urllib2
import csv
#arr1 =
#arr2 =
goal_visitors_middle =
goal_visitors = # type: List[Union]
goal_visitors1 =
new_element =
listOfSites =
r = urllib2.urlopen(url)
number = r.read()
a = ‘leon.ru desktop ’ + site +'.csv'
f = open(a, ‘w’)
f.write(number)
f.close()
b = r'CUsers/barba/PycharmProjects/Metrica/' + a
filepath = b
handle = open(filepath, “r”)
#data = handle.readlines()
for line in handle:
line = line.translate(None, ‘"’)
new_element = line.split(',')
goal_visitors_middle.append(new_element)
goal_visitors = goal_visitors_middle
handle = open(filepath, “w”)
i = 4
for i in range(4, len(goal_visitors_middle)):
if i % 3 == 0:
goal_visitors.append(goal_visitors_middle)
#goal_visitors = goal_visitors_middle
else:
constant = str(goal_visitors_middle)
goal_visitors1 = goal_visitors_middle*(1/float(constant))*100
goal_visitors.append(goal_visitors1)
#writer(open(filepath, “w”)).writerow(goal_visitors)
handle.close()