python – How to turn on line numbers in IDLE?
python – How to turn on line numbers in IDLE?
Version 3.8 or newer:
To show line numbers in the current window, go to Options
and click Show Line Numbers
.
To show them automatically, go to Options
> Configure IDLE
> General
and check the Show line numbers in new windows
box.
Version 3.7 or older:
Unfortunately there is not an option to display line numbers in IDLE although there is an enhancement request open for this.
However, there are a couple of ways to work around this:
- Under the edit menu there is a go to line option (there is a default shortcut of Alt+G for this).
- There is a display at the bottom right which tells you your current line number / position on the line:
Theres a set of useful extensions to IDLE called IDLEX that works with MacOS and Windows http://idlex.sourceforge.net/
It includes line numbering and I find it quite handy & free.
Otherwise there are a bunch of other IDEs some of which are free: https://wiki.python.org/moin/IntegratedDevelopmentEnvironments
python – How to turn on line numbers in IDLE?
If you are trying to track down which line caused an error, if you right-click in the Python shell where the line error is displayed it will come up with a Go to file/line which takes you directly to the line in question.
Related post:
- python – How to turn on line numbers in IDLE?
- user interface – Python error – IDLEs subprocess didnt make connection. Either IDLE cant start or personal firewall software is blocking connection.
- tkinter – Programming in Python: Getting name Tk is not defined only at Command Prompt, works in IDLE.
- Any way to clear pythons IDLE window?
- Wrap Text in Python IDLE.
- how do I launch IDLE, the development environment for Python, on Mac OS 10.7?
- Python IDLE won´t start.
- what is the difference between python shell and IDLE?
- Install python modules/package using IDLE on Windows.
- Pythons IDLE for Java.
- IDLE background color in python.
- python – IDLE subprocess startup error.