So i'm still working on my personal assistent code but for some reason i can't have a "\" where i want it. I want my program to take the 2th word i speak and use it to run a program with that name.
if words[0] == "atlas":
print("Succes")
if words[1] == "launch":
print("Launch Program")
p = words[2] + ".exe"
os.startfile("C:\Gebruikers\Jari\Snelkoppelingen\" + p)
elif words[1] == "internet" and words[2] == "search":
url = "https://www.google.be/webhp?hl=nl#hl=nl&q=" + '+'.join(words[3:])
webbrowser.open_new_tab(url)
else:
print("Unknown Command")
else:
print("Unknown Command")
The problem come's here:
os.startfile("C:\Gebruikers\Jari\Snelkoppelingen\" + p)
I need a "\" at the end of this line but it won't let me. Any suggestions?