Work with Sheets.

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.

  1. 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:Screen Shot 2017-08-07 at 1.40.11 PM
  2. Instead of using sheet.columns[1], use sheet[‘B’] like this:Screen Shot 2017-08-07 at 2.13.10 PM.pngOtherwise, you will see the below error message:Screen Shot 2017-08-07 at 1.44.54 PM.png

Below are some solutions for the practice projects:

  1. Multiplication Table MakerScreen Shot 2017-08-10 at 5.43.47 PM.pngAnd the below is what comes up in Excel when I entered python3 8  in Terminal:Screen Shot 2017-08-10 at 5.46.08 PM.png
  2. Blank Row InserterScreen Shot 2017-08-10 at 5.47.36 PM.pngI got the below when I entered python3 3 2 produceSales.xlsx:Screen Shot 2017-08-10 at 5.51.20 PM.png                 Screen Shot 2017-08-10 at 5.52.41 PM

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!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s