I'm looking for advice on optimizing my Python code to improve its runtime speed. I've already written a full calculator program using libraries like tkinter and sympy, but I'm not sure how to make it run faster. Any tips on what I can do to achieve better performance would be greatly appreciated!
4 Answers
Add a timing function to pinpoint which parts of the code are slow. Once you identify those areas, you can ask more detailed questions aimed at those specific code snippets for better advice.
It really depends on the type of optimization you're after—whether it's runtime performance, readability, or just cleaning up the code. If you can share some specific parts of your code that you're concerned about, that would help a lot!
First, focus on getting your program to work correctly. Once that's done, identify repetitive tasks in your code and remove them where possible. Familiarize yourself with the documentation on libraries and functions as those can offer faster alternatives or methods for efficiency.
That's what I'm asking. Can you suggest any specific improvements to make the code smaller and faster?
I've already streamlined it, but the execution is still slow. Any specific pointers?
Did you code all of this yourself or did you use any AI assistance?
I wrote it myself, but I did consult AI a few times to troubleshoot some serious errors.

I mean, I want it to run faster. Unfortunately, I can't post all the code since it's too long.