Python Forum
wrap_text with openpyxl. How to use documentation to resolve deprecation warning?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
wrap_text with openpyxl. How to use documentation to resolve deprecation warning?
#5
I learned that I did not have the latest openpyxl version. pip install openpyxl installed 2.5. I upgraded it to 3.0.
Now when I look at https://openpyxl.readthedocs.io/en/stable/index.html it makes more sense :-)

I now know that the "Working with Styles" section of the openpyxl 3.0 documentation is the place to go for formatting data.

So I click that, and go to https://openpyxl.readthedocs.io/en/stable/styles.html

That page show me this:

>>> alignment=Alignment(horizontal='general',
... vertical='bottom',
... text_rotation=0,
... wrap_text=False,
... shrink_to_fit=False,
... indent=0)

and I could use that info to wrap text with this line:
cell.alignment = Alignment(wrapText=True)
Now things are starting to make sense for me. :-) Thanks!
Reply


Messages In This Thread
RE: wrap_text with openpyxl. How to use documentation to resolve deprecation warning? - by curranjohn46 - Oct-09-2019, 01:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  openpyxl documentation OldMainframeProgrammer 3 623 Dec-20-2023, 08:39 AM
Last Post: buran
  how to avoid deprecation notice merrittr 5 1,167 Nov-27-2023, 11:12 PM
Last Post: rob101
  PyPDF2 deprecation problem gowb0w 5 4,143 Sep-21-2023, 12:38 PM
Last Post: Pedroski55
  [split] How to resolve version conflicts in Python? atonalwilson 1 1,002 May-04-2023, 09:02 AM
Last Post: buran
  How to resolve version conflicts in Python? taeefnajib 0 932 Apr-27-2023, 08:37 PM
Last Post: taeefnajib
  How to resolve my problem in Pycharm? bshoushtarian 0 863 Sep-26-2022, 11:45 AM
Last Post: bshoushtarian
  Solving equation equal to zero: How to resolve the syntax error? alexfrol86 3 1,987 Feb-21-2022, 08:58 AM
Last Post: deanhystad
  win32com — How to resolve “AttributeError: xlUp” for Excel files? JaneTan 2 4,250 Aug-18-2021, 05:27 AM
Last Post: snippsat
  How to resolve Index Error in my code? codify110 6 3,042 May-22-2021, 11:04 AM
Last Post: supuflounder
  How to resolve numpy ValueError: dtype.descr Py_veeran 0 1,852 Aug-18-2020, 06:46 PM
Last Post: Py_veeran

Forum Jump:

User Panel Messages

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