execl problem on linux

Robert Cragie rcc at nospamthanks_jennic.com
Wed Apr 26 04:49:15 EDT 2000


Michael Esveldt <dante at oz.net> wrote in message
news:8e63b2$6v2$0 at 216.39.162.232...
| This may be bordering on off topic but the following is happening with
| all the exec() methods...
|
| Python 1.5.2 (#0, Apr  3 2000, 14:46:48)  [GCC 2.95.2 20000313 (Debian
| GNU/Linux
| )] on linux2
| Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
| >>> import os
| >>> os.execl("/usr/bin/vim")
| Internal error: lalloc(0, )
| Internal error: lalloc(0, )
| bash-2.03$
|
| I'm at a loss, any ideas?

I think you might be better off using system(), or popen() (or popen2()) if
you need to pipe stuff into (and out of) the process. I found the following
works:

>>> import os
>>> os.system("/usr/bin/vim")

I'm not sure why execve() doesn't work, but I presume it might be something
to do with the command taking over the process which calls execve(), whereas
I presume system() etc. spawn a separate process. Maybe the real experts can
help here :-)

Robert





More information about the Python-list mailing list