这两行代码给出了PermissionError: [WinError 5]
path = r'C:\\Users\\danil\\"Google Drive"\\Python3\\"Youtube API 2.0"\\GUI\\programmi\\phase.exe'
subprocess.call([path])我已经尝试过通过cmd和powershell来执行它,我没有得到任何问题,即使不是作为管理员
发布于 2019-05-18 04:16:14
1)使用管理员权限打开IDE,或将文件夹从C盘移动到其他盘。2)如果您信任防病毒软件,请将您的脚本和exe添加到防病毒软件的排除列表中。
发布于 2020-01-30 14:29:04
我昨天遇到了同样的问题,我使用
subprocess.call([path])然后我尝试了下面的方法,它起作用了
subprocess.run(path, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode('utf-8')希望能有所帮助
发布于 2020-01-30 14:40:53
你有没有试过删除几个路径组件两边的双引号?哦,因为您已经使用了r前缀,所以不需要将反斜杠加倍。
path = r'C:\Users\danil\Google Drive\Python3\Youtube API 2.0\GUI\programmi\phase.exe'
subprocess.call([path])https://stackoverflow.com/questions/56192317
复制相似问题