Python Forum
This is a pain, is there a quicker way to do this?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
This is a pain, is there a quicker way to do this?
#2
I suggest a function
def update_vertically(sheet, col, row, items):
    row = int(row)
    for i, value in enumerate(items):
        sheet['{}{}'.format(col, row+i)].value = value
        
update_vertically(sheet, 'A', 2, ['0{}'.format(i) for i in range(3, 11)])
Also I don't know which module you are using to create the spreadsheet, but it may have a builtin way of "updating vertically"...
Reply


Messages In This Thread
RE: This is a pain, is there a quicker way to do this? - by Gribouillis - Nov-02-2018, 06:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  3 easy questions for python programmers but 3 pain in the ass for me grjmmr 6 4,027 Jul-22-2018, 08:41 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020