How to make prompt (>>>) in center of Python IDLE

633 views Asked by At

I am writing code in python shell when I enough writing code prompt(that angle bracket goes to bottom of the shell which is quite difficult to record something with that).

Check this image how my angle bracket are in the bottom of the shell

prompt is in bottom of Python shell

prompt is in bottom of Python shell

What I want is angle bracket prompt is in the middle of Python shell

angle bracket prompt is in the middle of python shell

Is there's any setting or shortcut to make my prompt to move upward and put it in middle of shell? It's quite easy in CMD where I use slide which is in right side, but that things not working in Python IDLE.

1

There are 1 answers

0
Terry Jan Reedy On BEST ANSWER

I understand what you mean about using the scrollbar on the right side of Windows CommandPrompt. But a Windows console and the tkinter text widget used by IDLE operate completely differently. CommandPrompt has a fixed number of lines, limited in width, that start blank. That fixed number defaults to 300. It can be increased up to 9999. After printing that fixed number, printing more lines replaces existing lines. The Tk/Tkinter text has a variable number of lines, starting with 0 and expanding indefinitely as lines are entered. (I have gone over 500_000.) So there is literally nothing on or below the prompt line until you enter it or until Python outputs lines while compiling or executing your code. One cannot scroll up the prompt when there is nothing below the prompt to appear on the screen.