系统找不到指定的路径.(Google chrome - Windows)



这是一个语音助手,我试图应用谷歌地图虽然。出现错误-
"系统无法找到指定的路径。"…我认为问题出在申请地点。我该如何解决这个问题?

下面是我的代码:
if "where is" in data:
listening = True
data = data.split(" ")
location_url = "https://www.google.com/maps/place/" + str(data[2])
respond("Hold on Sienan, I will show you where " + data[2] + " is.")
maps_arg = '/usr/bin/open -a "C:/Program Files/Google/Chrome/Application/Google Chrome.app"' + location_url
os.system(maps_arg)

maps_arg ='/usr/bin/open -a "C:/Program Files/Google/Chrome/Application/Google Chrome.app"'+ location_url

立即我可以看到问题确实是在maps_arg行作为/usr/bin/open是在Linux中找到的目录,而不是windows,尝试删除它和- a留给你

maps_arg = "C:/Program Files/Google/Chrome/Application/chrome.exe {}".format(location_url) 

如果这不起作用,请尝试删除路径周围的双引号。

if "where is" in data:
listening = True
data = data.split(" ")
location_url = "https://www.google.com/maps/place/" + str(data[2])
respond("Hold on Sienan, I will show you where " + data[2] + " is.")
webbrowser.open(location_url)

相关内容