gpt4 book ai didi

python - 如何打开位于 'This PC' 的 windows 资源管理器?

转载 作者:可可西里 更新时间:2023-11-01 11:42:40 26 4
gpt4 key购买 nike

如何在使用 Windows 10 时使用 python 3.6 在“此电脑”中打开 Windows 资源管理器?我不确定“这台电脑”的路径是什么。 (以前是“我的电脑”)。我可以使用以下方法将 Windows 资源管理器打开到已知路径:

import os

os.startfile(os.path.realpath(DIRECTORY_PATH))

最佳答案

所以,我试了一下,没有找到通向“This PC”的简单路径。

我找到了 this尽管该页面遍历了您可以提供给 explorer.exe 的参数,但看到了 ,:

import subprocess
subprocess.run(["explorer", ","])

关于python - 如何打开位于 'This PC' 的 windows 资源管理器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54934916/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com