无阻塞命令过程

2024-05-23 23:34:28 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图运行命令:

! sudo chromium-browser --no-sandbox www.google.com

通过命令行

我也试过:

! sudo chromium-browser --no-sandbox www.google.com

并添加到sh脚本文件中,其中输出为:

sudo ./ruunn.sh
 --disable-quic --enable-tcp-fast-open --disable-gpu-compositing --ppapi-flash-path=/usr/lib/chromium-browser/libpepflashplayer.so --ppapi-flash-args=enable_stagevideo_auto=0 --ppapi-flash-version=
Fontconfig warning: "/etc/fonts/fonts.conf", line 160: blank doesn't take any effect anymore. please remove it from your fonts.conf
[8232:8232:1210/204151.324275:ERROR:gpu_process_transport_factory.cc(1029)] Lost UI shared context.
[8232:8327:1210/204151.671927:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
ATTENTION: default value of option force_s3tc_enable overridden by environment.
[8331:8331:1210/204154.008745:ERROR:sandbox_linux.cc(375)] InitializeSandbox() called with multiple threads in process gpu-process.

浏览器成功打开。问题是python脚本没有返回,因此无法执行其他命令。有没有一种方法可以在不阻塞的情况下执行命令?我在jupyter笔记本上执行这些命令。在


Tags: no命令browsergpuenablewwwsudofonts
2条回答

如果使用&跟踪bash命令,那么它将变为非阻塞。关于这个here还有更多细节

With & the process starts in the background, so you can continue to use the shell and do not have to wait until the script is finished.

你的案子呢

! sudo chromium-browser  no-sandbox www.google.com &

你应该看看screen command。在

相关问题 更多 >