[Tutor] working code for adding line numbers -- request for criticism

Alan Gauld alan.gauld at blueyonder.co.uk
Sat Apr 17 18:39:12 EDT 2004

> I've found that traceback errors identified by line numbers can be
tricky to
> track down without line number indications in the code or the
editor. (IDLE
> doesn't seem to provide for line numbers,

FWIW IDLE has a "Go To Line" menu option (Alt+G) which takes you to
the line you need.

> So, I wrote a script to take a file and output a file
> with line number comments added.

But it's a good enough idea since notepad users (why???)
can use it. :-)

> fil_numberede. I can see how to fix that (by constructing the output
> differently depending on whether the filename contains a '.' or not,
but it
> didn't seem worth doing.

Or put "numbered_" in front instead:


Just some ideas,

Alan G

More information about the Tutor mailing list