Squashing bugs in Python

I’ve been working on a script that iterates through a rather massive Excel sheet using openpyxl. The Excel sheet has 26 tabs with pages of data cells in each tab.

Due to company policy, I used PyCharm. Not my favourite editor. Actually, I really dislike most things about PyCharm. But still, company policy. After squashing the first few bugs in my code, the debugger ran for 4 hours and then crashed due to some inexplicable memory overflow error. Tried some fixes, but had to go through the 4 hours of waiting again to get another inexplicable memory overflow in a slightly different place. So I put in some code for garbage collection, and deleted some variables after I didn’t use them to see if that would help memory. It did. 6 hours later, same crash but much later. Frustration.

Googled around and found someone mentioning WingWare. Fond memories of my days with WingIDE came to mind, back in version 3 (now 7). And lo and behold if they don’t offer a free version now, so I can ignore company policy and just install the free stuff. Badabing badaboom, 1½ hours later I got to the end of my code where WingIDE highlighted a bug for me. 75 % faster than PyCharm.

1½ hours is still a bit too long of a wait, and I am getting sick of jumping between things to do while waiting, so I have spent some time to partition my code to I am evaluating small parts first and then the whole. But it just struck me as kind of amazing that an IDE that is one of the most popular is so much slower than WingIDE. Since I also vastly favor the UI of Wing the choice is quite obvious for me, now that I know I have a choice.

Anyway, I figure since they saved me hours of my time, the least I can do is to advertise their product a bit. And I will be sure to try and find a way to source some cash for the full version. Finding out there is a free version I can just use really made my day, but I would prefer to have the full version.

Debug entire process6 hours for 80%1.6 hours
Run script in python command lineN/A1 hour
Posted in IT

Leave a Reply

Your email address will not be published. Required fields are marked *