[英]python vte: get the pid of the fork process
我正在使用VTE術語來運行bash腳本
self.child_pid = self.v.fork_command(None, ['/bin/bash', 'dPluzz-cli', dest, '-u', adresse])
如何獲得pid的編號? 我試過了
os.getpid()
但是pid是我的python程序的編號。
謝謝!
解決了...
id = self.child_pid
老問題,現在需要spawn_sync
而不是spawn_sync
:
https://lazka.github.io/pgi-docs/Vte-2.91/classes/Terminal.html#Vte.Terminal.spawn_sync
spawn_sync
返回一個tuple
,第二個元素是pid。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.