[Tutor] while with function

Magnus Lycka magnus@thinkware.se
Tue Nov 19 07:48:27 2002


At 07:11 2002-11-19 -0500, fleet@teachout.org wrote:
>On Tue, 19 Nov 2002, Magnus Lycka wrote:
>
> > Check this out!
> >
> > # edit.py (c) Magnus Lyck=E5, magnus@thinkware.se, 2002
> > import os, tempfile
>
>Saved the file, ran with python2, get following error:
>sh: /tmp/@9273.0txt: Permission denied

This is because $EDITOR isn't set. Then you will basically
try to execute the file /tmp/@9273.0txt, and its execution
flag isn't set. (Wouldn't do much good anyay...)

As I wrote in the code, $EDITOR must be set, or you have to
use one of the commented out variants.

Either run
$ export EDITOR=3Dvi
(assuming that you use bash)

or change the source to

data =3D edit(data, editor=3D'vi')

(or joe, or xemacs or whatever editor you prefer)


--=20
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se