import os import shutil chrootexe = shutil.which("chroot") os.execv(chrootexe,[ chrootexe, _chroot["dir"] ] + _chroot["args"] )