'Asycn interation in python loop with spreadsheets
__Hello! I'm using Google API. And I have a dictionary with, for example, 10 keys. And I have 12 columns, which two of them are empty. I created a loop (for key in dic) and if statement where check empty columns. And this is a problem, because my values are dismissed.
for key in dic:
userTimelist = [[]]
i = 0
row = dic[key]
monthUser_range = "Everyday!" + str(row) + str(col_from) + ":" + str(row) + str(col_to) #A109:A142, B109:B142, C109:C142, ...
read_data_list = read_data(monthUser_range)
# Passing inactive users
if read_data_list == []:
pass
else:
userTimelist[i].append(key)
userTimelist[i].append(read_data_list)
userTimelist[i].append(yesterday_time(dic[key]))
print(userTimelist[i])
structure.append(userTimelist[i])
i+=1
The empty columns are in the middle of whole array. And I have no idea, for example, how to merge two ranges without these two empty columns. Or maybe, Is there another beautiful solution?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|