I have a python list which contains a list of software names: list = ['CodeBlocks', 'Foxit Software', 'GSettings', 'Wintertree', 'WordWeb']
I want to insert this list in a column in google sheet
how to insert it using gspread and api in python
From I have a python list which contains a list of software names: list = ['CodeBlocks', 'Foxit Software', 'GSettings', 'Wintertree', 'WordWeb']
, I want to insert this list in a column in google sheet enter image description here
and how to insert it using gspread and api in python
, I believe your goal is as follows.
list = ['CodeBlocks', 'Foxit Software', 'GSettings', 'Wintertree', 'WordWeb']
to the column "E" of Google Spreadsheet using gspread for python.In this case, how about the following sample script?
import gspread
client = gspread.oauth(###) # Please use your client.
sampleValue = ["CodeBlocks", "Foxit Software", "GSettings", "Wintertree", "WordWeb"] # This is from your question.
spreadsheetId = "###" # Please set your Spreadsheet ID.
sheetName = "Sheet1" # Please set the sheet name.
sheet = client.open_by_key(spreadsheetId).worksheet(sheetName)
sheet.update("E1", [[e] for e in sampleValue], value_input_option="USER_ENTERED")
["CodeBlocks", "Foxit Software", "GSettings", "Wintertree", "WordWeb"]
is required to convert to [["CodeBlocks"], ["Foxit Software"], ["GSettings"], ["Wintertree"], ["WordWeb"]]
at [[e] for e in sampleValue]
.['CodeBlocks', 'Foxit Software', 'GSettings', 'Wintertree', 'WordWeb']
is put into the column "E".E1
. When E1
is modified to E10
, the value is put from "E10".