How to launch game with urls with python?
Question:
Using and opening Epic Games Launcher games, I have noticed that they run by using a strange url from the desktop icon. I was wondering, how can I get python to get this to launch the game? (I have already tried running the game’s exe in its respective file location, but that does nothing)
Example url, with the desktop icon being a .url file extension
com.epicgames.launcher://apps/9773aa1aa54f4f7b80e44bef04986cea%3A530145df28a24424923f5828cc9031a1%3ASugar?action=launch&silent=true
I have tried running the exe file, but I can’t figure out how to run that specific url, maybe I could pass it as a command line argument into the exe?
Answers:
Only Windows uses .url
extensions for shortcuts. You could try using subprocess
module
from subprocess import Popen, PIPE
game = "com.epicgames.launcher://apps/9773aa1aa54f4f7b80e44bef04986cea%3A530145df28a24424923f5828cc9031a1%3ASugar?action=launch&silent=true"
Popen(["explorer", game], stdin=PIPE, stdout=PIPE)
Otherwise, you can also call the exe
from there, too.
Using and opening Epic Games Launcher games, I have noticed that they run by using a strange url from the desktop icon. I was wondering, how can I get python to get this to launch the game? (I have already tried running the game’s exe in its respective file location, but that does nothing)
Example url, with the desktop icon being a .url file extension
com.epicgames.launcher://apps/9773aa1aa54f4f7b80e44bef04986cea%3A530145df28a24424923f5828cc9031a1%3ASugar?action=launch&silent=true
I have tried running the exe file, but I can’t figure out how to run that specific url, maybe I could pass it as a command line argument into the exe?
Only Windows uses .url
extensions for shortcuts. You could try using subprocess
module
from subprocess import Popen, PIPE
game = "com.epicgames.launcher://apps/9773aa1aa54f4f7b80e44bef04986cea%3A530145df28a24424923f5828cc9031a1%3ASugar?action=launch&silent=true"
Popen(["explorer", game], stdin=PIPE, stdout=PIPE)
Otherwise, you can also call the exe
from there, too.