On 21/05/12 01:41, Steven D'Aprano wrote:

That is insanity! There is only One True EDitor, ed! It is right there
in the name, it's an EDitor! ed is the true unix editor:

http://www.gnu.org/fun/jokes/ed.msg.html

Having once had no alternative to ed and a 3500 line C program to write, I don't get the joke! (but I did get very tight C!) :-(

$ cat > hello.py
print 'hello world'
^D
$ ed -p'->' hello.py
20
->1,$p
print 'hello world'
->i
for n in range(3):
.
->1,$p
for n in range(3):
print 'hello world'
->2s/print/   print/
->1,$p
for n in range(3):
   print 'hello world'
->wq
42
$

Note I made ed more "user friendly" by including a prompt (->)...

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to