In the Pygsheet reference doc here it shows a wrap_strategy property.
wrap_strategy
How to wrap text in this cell. Possible wrap strategies: ‘OVERFLOW_CELL’, ‘LEGACY_WRAP’, ‘CLIP’, ‘WRAP’. Reference: api docs
But in actual code if I were to cell.wrap_strategy = 'WRAP' I get an error TypeError: 'str' object is not callable
Actual code snippet:
for cell in wsheet.range("L3:L20").pop():
cell.wrap_strategy('WRAP')
I believe your goal as follows.
Modification points:
wrap_strategyof pygsheets, it seems that this is the Class Cell and in this case, I think that in the case offor cell in wsheet.range("L3:L20").pop():, you can usecell.wrap_strategy = 'WRAP'. (In this case, it sets to "L20".)From this, how about modifying your script as follows?
Modified script:
or, as other direction, how about using
get_valuesas follows?Note:
Reference:
Added:
From your following replying,
When I saw your script in your question, you wanted to use the last element of
wsheet.range("L3:L20")because ofpop(). So I followed to it. From your replying, when you want to set the wap strategy for "L3:L20" by modifying your script, how about the following sample script?Sample 1:
Sample 2: