Long Live Python!
Bruce Sass
bsass at freenet.edmonton.ab.ca
Thu Jul 12 20:26:21 EDT 2001
On Thu, 12 Jul 2001, Skip Montanaro wrote:
<...>
> Well, no, but I might run this file as "python mycode.py" (ten-minute hack -
> buyer beware) and type either Python or shell commands at the interpreter
> prompt:
<...>
> The output looks like
>
> % python mycode.py
> Python 2.1.1c1 (#13, Jul 10 2001, 17:30:38)
> [GCC 2.96 20000731 (Linux-Mandrake 8.0 2.96-0.48mdk)] on linux2
> Type "copyright", "credits" or "license" for more information.
> (Console)
> >>> wc -l /etc/termcap
> 16412 /etc/termcap
> >>> f = open("/etc/termcap")
> >>> f.readlines()[10]
> '# Please e-mail changes to terminfo at thyrsus.com; the old termcap at berkeley.edu\n'
> >>>
>
> ;-)
The Python interpreter should do this right out-of-the-box,
or maybe Python embedded in Bash would work. ;-)
- Bruce
More information about the Python-list
mailing list