I thought I would share some updates on OpenPxXL for ‘Working with Excel Spreadsheets‘ even though it was pretty easy to Google for the solutions for the errors I came across.
- Instead of using openpyxl.cell import get_column_letter, column_index_from_string, use from openpyxl.utils import get_column_letter, column_index_from_string. Otherwise, you will come across the below error:
- Instead of using sheet.columns, use sheet[‘B’] like this:Otherwise, you will see the below error message:
Below are some solutions for the practice projects:
- Multiplication Table MakerAnd the below is what comes up in Excel when I entered python3 multiplicationTable.py 8 in Terminal:
- Blank Row InserterI got the below when I entered python3 blankRowInserter.py 3 2 produceSales.xlsx:
I was stuck for awhile on the first one and it took me some time to make sense of it. Practice makes perfect for Python and I’m learning to accept that I’m going to make mistakes and learn from them to get better at this.
My updates are lacking this week as my progress is extremely slow this week. Hopefully it will get better next week!