I want to launch Valorant (it's a game) we can't run it directly from the .exe file we have to run by adding few lines at the end of the .exe file as shown below.
"D:\Games\Riot Games\Riot Client\RiotClientServices.exe" --launch-product=valorant --launch-patchline=live
I tried this(didn't work):
if 'valorant' in query:
os.startfile("D:\\Games\\Riot Games\\Riot Client\\RiotClientServices.exe" --launch-product=valorant --launch-patchline=live )
speak('okay')
CodePudding user response:
Try to use subprocess: https://docs.python.org/3.2/library/subprocess.html
There is an example with an argument like this:
subprocess.call(["ls", "-l"])
CodePudding user response:
I think using subprocess.run([path, command, command])
would work.
In your code it would be:
import subprocess
if 'valorant' in query:
subprocess.run(["D:\\Games\\Riot Games\\Riot Client\\RiotClientServices.exe", "--launch-product=valorant", "--launch-patchline=live"])
speak('okay')