[Tutor] program idea

Don Arnold darnold02@sprynet.com
Thu May 15 07:22:01 2003


----- Original Message -----
From: "Kristoffer Erlandsson" <krier115@student.liu.se>
To: "Python Tutorial" <tutor@python.org>; "Kirk Bailey" <idiot1@netzero.net>
Sent: Thursday, May 15, 2003 2:21 AM
Subject: Re: [Tutor] program idea


> On Thu, May 15, 2003 at 12:09:48AM -0400, Kirk Bailey wrote:
> > I have abn idea for a tool program.
> > it would read in a script, and write it out again with a line number in
a
> > comment  at the end of each line, as
> >
> > f1=open(filename,mode) #121
> > owner=string.strip(f1.readline()) #122
> > passwd=string.strip(f1.readline()) #123
> > f1.close() #123
> > ##124
> >
> > etc.
> > Line numbering gets VERY confusing if you slip up even a little when
doing
> > it by hand.
> >
> > Another would remove such and redo it when creating a new version with
new
> > lines in teh script.
> >
> > Any discussion?
>
> I really fail to see the need of this. Every editor that call itself an
> editor can display line numbers and move you to a specified line number
> by a couple of keypresses. So why would you need this? Maybe you have an
> other reason, I'd be happy to know.
>

Inside the editor, you know how the lines are numbered. But where do those
numbers go when you email the code to the Tutor list? It can be quite useful
to be able to say "I'm having a problem on line #115." instead of "I'm
having a problem in my 'for item in list' loop in the Foo() function when I
try to append bar to the list." Much more succint.

> Regards,
> Kristoffer
>
> --
> Kristoffer Erlandsson
> E-mail:  krier115@student.liu.se
> ICQ#:    378225

Don