pytho os.system 的异常 in_progress_cache_impl。。

当我在 使用python 的 python

os.system(r'"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"')chrome

来打开应用的时候,第一次 执行的时候,没有问题,屡次或者再次执行可能就会出现下面的状况了报错了:api

ERROR:in_progress_cache_impl.cc(189)] Cache is not initialized, cannot Retriit

Could not read download entries from file because there was a read failureio

 

或者是  执行了打开 了 应用了,  接下来的  代码,没有起效果。file

我刚开始觉得 是 其余代码的 不兼容的问题, 原来不是。。。im

改成 :兼容

win32api.ShellExecute(0, 'open', 'D:/Program Files (x86)/open/launcher.exe', '','',1)

 

便可。

os.system 感受适合第一次 打开应用 这样的场景。

相关文章
相关标签/搜索