Download Latest Version pyEdlin-0.1.zip (8.7 kB)
Email in envelope

Get an email when there's a new version of pyEdlin

Home / pyedlin / 0.1 Initial Release
Name Modified Size InfoDownloads / Week
Parent folder
pyEdlin-0.1.zip 2005-01-02 8.7 kB
LICENSE 2005-01-02 1.5 kB
README.txt 2004-12-29 1.7 kB
Totals: 3 Items   11.9 kB 0
This is the inital release of pyEdlin, and this is it's preliminary release notes.


pyEdlin is a python-based implementation of a line editor similar to the DOS 'edlin' command.  It allows line-oriented editing of an input stream, normally (but not necessarily) stdin.

I personally find it useful while at the interactive Python prompt.  Let's say you are prototype a method.

>>> def func():
...     for i in range(100):
...        retval = retval * retval / mult
...     return retval
...

Oops, ou forgot to initialize retval, and you want mult to be a parameter.  You need to retype the entire thing, or recreate the entire thing line by line, using the up arrow over and over again.


After going through all that trouble, you decide to give the edlin package a try.
The prototyping looks like this:

def func(mult):
  retval = mult + 3
  for i in range(100):
    retval = retval * retval / mult
  return retval

func(27)

def func():
  for i in range(100):
    retval = retval * retval / mult
  return retval

>>> import edlin
>>> ed = edlin.edlin()
>>> ed.edlin()
*a
   1:*def func():
   2:*  for i in range(100):
   3:*    retval = retval * retval / mult
   4:*^Z
*1a
   2:*  retval = mult
   3:*^Z
*l
   1: def func():
   2:   retval = mult
   3:*  for i in range(100):
   4:     retval = retval * retval / mult
*1
   1:*def func():
   1:*def func(mult):
*


You run your code with the Write command, 'w'.
*w
*

Doesn't do much, does it.  Well, so far, all you've done is define a method; you haven't called it yet.  You have two ways of doing that.

 1) You append the method call to the code, and run it all again:

Source: README.txt, updated 2004-12-29