1 from gi.repository import GObject
3 def spawn_child(command, callback):
6 @param command: an argument vector. First element is used as argv[0] and
7 used as executable to look up in $PATH.
8 @type callback: (pid, condition) -> None
9 @param callback: is executed when the command completes
11 @returns: the child process pid and the event id of the callback
13 ret = GObject.spawn_async(command,
14 flags=GObject.SPAWN_SEARCH_PATH | GObject.SPAWN_DO_NOT_REAP_CHILD)
17 watch = GObject.child_watch_add(pid, callback)