process wrapper?

Donn Cave donn at u.washington.edu
Mon Mar 29 16:55:06 EST 2004


In article <2pWdnQuWrvGhE_Xd38DK-g at speakeasy.net>,
 "Steve @ Waypath" <steve at waypath.com> wrote:
...
> For reasons not clear to me, I get the error:
>       bad interpreter: No such file or directory
> when I include the path to the python interperter. I've tried a number of
> approaches:
>   #!python
>   #!/usr/bin/python
>   #!/usr/bin/env python
> 
> (I've got the x bit set on the test files, so it's not a permissions
> problem. ) This, I'm guessing, isn't a python problem, and would seem to be
> my roadblock. I've done some preliminary searches for an answer, but nothing
> has panned out so far; if anyone has any ideas...

The first one wouldn't work for sure.  Second one works if python
is in /usr/bin, third one works if python is in some directory in
PATH and env is in /usr/bin.  Assuming your own shell is bash,
try "type python" and "type env" to see where those programs are.

[re zombie processes]
> I've read other posts (many yours, I think :) indicating something like
> this, but I confess I don't understand the relationship between waitpid()
> and spawnv(), how I would use the former with the latter.

spawnv returns a process ID, if you use os.P_NOWAIT.  It returns
the process exit status if you use os.P_WAIT.  If you look at the
code, in os.py, you will see that this second variation is essentially
implemented by applying waitpid() to the first.

   Donn Cave, donn at drizzle.com



More information about the Python-list mailing list