execl problem on linux

Fredrik Lundh fredrik at pythonware.com
Wed Apr 26 05:26:11 EDT 2000


Michael Esveldt wrote:
> 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")

in addition to the name of the executable, execl also expects
you to give it some arguments to put into sys.argv.

since argv[0] is supposed to contain the name of the program,
this should work:

    os.execl("/usr/bin/vim", "vim")

</F>





More information about the Python-list mailing list