I'm using a vte term to run a bash script
self.child_pid = self.v.fork_command(None, ['/bin/bash', 'dPluzz-cli', dest, '-u', adresse])
How can I do to get the number of the pid ? I tried
os.getpid()
but the pid is the number of my python program..
Thanks!
Solved...
id = self.child_pid
Old question, instead of fork_command you now need spawn_sync
:
https://lazka.github.io/pgi-docs/Vte-2.91/classes/Terminal.html#Vte.Terminal.spawn_sync
spawn_sync
returns a tuple
, second element is pid.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.