A zvt fork question


I really don't know if this is a gnome question or pygnome one or a 
plain kernel issue!

Anyway, I am using pygnome and zvt.

Then I do a fork like this one:

pid= term.forkpty()

For resource usage, I need to catch the pid of the child process.

But, this fork looks weird to me.

If I do a :

print pid

then I get two numbers, the exit number which is 0 for success and 
before it "usually" (sometimes after it" the pid number.

Now, I haven't found a way to know which one comes first.

My workaround is to open a tmp file, use


Then try to parse it to detect 0 and separate it from real pid.

It works, but I was wondering if there was any other way to get that 
pid without going through all those computations! It's psychologically 

Thanks in advance!

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]