cuốn sách gpt4 ai đã làm

python - Sử dụng Python để đóng trình duyệt Chrome trên Win7 trở lên

In lại Tác giả: Vũ trụ không gian Thời gian cập nhật: 2023-11-03 19:57:53 25 4
mua khóa gpt4 Nike

The specific task to close好吧,我花了一些时间研究如何做到这一点,我得到的最接近的是:

os.system("powershell.exe Get-Process chrome | Stop-Process")

但后来我得到了这个错误:

如果我从 CMD 运行此命令,它就会起作用,并且 chrome 窗口将关闭,其中包含所有选项卡。

'Stop-Process' is not recognized as an internal or external command, operable program or batch file.

我尝试过使用'''os.system(taskkill/IM/F chrome.exe)'''(及其所有选项)

什么都没有。我得到的最好的就是“Oh, Snap”页面。 (主要的 chrome 进程没有关闭)。

Cảm ơn!

câu trả lời hay nhất

Bạn nên làm điều này:

os.system("powershell.exe -command Stop-Process -Name 'chrome'")
os.system("taskkill /im chrome.exe /f")

关于python - Win7以上使用Python关闭Chrome浏览器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59446075/

25 4 0
không gian vũ trụ
Hồ sơ

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá taxi Didi miễn phí
Phiếu giảm giá taxi Didi
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress