Python 2.7 Tkinter problems.

This is the place for queries that don't fit in any of the other categories.

Python 2.7 Tkinter problems.

Postby BlueKitties » Mon Mar 17, 2014 2:51 pm

I have a rather large project I developed in Python 2.5, and I decided to migrate to Python 2.7. Everything was going beautifully, until I ran into a rather odd error. I am using a text view widget to display a list of widgets, each of which display customer information -- there are around 2,000 accounts at the moment. Now, everything has worked smoothly on Py2.5/Windows7, but since migrating to Py2.7/Windows8, my program will not launch if the account list is over 300. With over 300 accounts, everything will run good up until Tk.mainloop is called, at which point no windows are displayed and the Python2.7 process eats up about 40% of my processor.

I'm about to create a work-around where instead of initializing and packing widgets for each customer, I'll create a small number of widgets, and swap-out widget text as the user "scrolls" through the customer selector. Before I begin doing that though, I'd like to know if there's a more simple fix -- like I said, my current implementation works fine on multiple machines running Windows 7 and Python2.5. If it has anything to do with it, I'm also using a Surface Pro -- I imagine it may be an issue with how the Surface handles graphics. Again though, everything works like a charm so long as I only feed the text widget under 300 account windows.

I've done a tremendous amount of Googling, and so far I've yet to turn up anything useful.
Posts: 4
Joined: Sat Sep 28, 2013 9:28 pm

Re: Python 2.7 Tkinter problems.

Postby metulburr » Mon Mar 17, 2014 5:35 pm

Its hard to determine without seeing any code. If you can duplicate the same error and post it here, that would be helpful.

You should minimize your changes from the original working one....check python2.7 on windows 7 and see the results first before moving to windows 8. The more you change the more chance of something going wrong, making it hard to narrow down the culprit

Did you copy the code and move it windows 8 and change the needed 2.5/2.7 differences? Or did you re-write the entire thing? if you re-wrote it, recheck the differences to see if you changed something for the worse without knowing it.
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
User avatar
Posts: 2145
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: Python 2.7 Tkinter problems.

Postby BlueKitties » Tue Mar 18, 2014 3:38 pm

I began re-implementing, where instead of giving each customer a widget, I have a set of widgets which swap-out customer data as need be to give the illusion of "scrolling." On my original Win7/Py25 setup, I reduced RAM usage from about 95kmb to 20kmb, and reduced processor usage significantly. I'm not sure what the exact bug was, but this new approach is vastly more efficient so I'll go with this instead of debugging.

Thanks for the input though, it's much appreciated. I'll keep that approach in mind in the future.
Posts: 4
Joined: Sat Sep 28, 2013 9:28 pm

Return to General Coding Help

Who is online

Users browsing this forum: Google [Bot] and 4 guests