Issues that I chose

I'd noticed in my own time teaching python that IDLE came without a "clear-screen" shortcut that is very natural to other shells so I thought: "Wait... I can do that!"

My approach

This was my first time working on a much larger pure python project, everything IDLE is within an 'idlelib' directory buried in the standard library of the CPython interpereter (the reference one that everyone knows). 'idlelib' has about 80 files and about 80% of which are python modules so first things first I needed to understand the general control and logic flow between the modules:

I started by profiling a quick run of IDLE using the 'pdb' (Python debugger). Then I ran it through a profiler visualizer, snakeviz (3rd party), after which I had a very interactive circle graph to explore which functions from which files called which and this gave me a good high-level understanding to start. Next I found where keyboard shortcuts where stored and did a search across the files for the unique syntax with the bash command (grep -rni "<<" ./Lib/idlelib). Lastly I dove into each of the files that took advantage of similar keyboard shortcuts and added mine.

Deciding on a shortcut key was tought because I had to look at all the possibilities that are taken across each platform if I want a consistent cross-platform shortcut that wasn't taken: ultimately I decided on .

After I had given myself access to a unique key-combination, I added a couple of methods in the right places in this large OOP directory and with enough study I figured out how to work just enough with Tkinter (the graphical library shipped with python that's used to render this graphical application) and grabbed the height of the current window dynamically as any decent <> should do. The only thing left is for me to get the prompt that ends up isolated at the bottom of the screen to return to the top ...and I already have a good suspicion for how.

Contribution status

I'm soon to submit a PR, but like any good citizen, I need to include some tests for my feature and update their documentation before I check it in.

Built With

Share this project:

Updates