Open .exe with godot

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ReudsFratt92

I have got a program written in python, that I compiled as .exe. I want to create gui in godot and then run my exe wiyh parameters.
How do i do that?

You need to write it like that:

OS.execute('C:/Users/Seppoday/AppData/Roaming/Spotify/Spotify.exe', [], true)

Path have that slash “/” not that "" and you add array, and true or false at the end.

GIF:Imgur: The magic of the Internet

sporx13 | 2022-02-10 19:32

:bust_in_silhouette: Reply From: sash-rc
OS.execute('shell_command', [])

I tried

func _ready():

error: Too few arguments for “execute()” call. Expected at least 2.

ReudsFratt92 | 2022-02-10 19:07

OS.execute("cmd.exe", ["D:\Coding\ascii\dist\main.exe"])

doesn’t return error, but neither executes the file

ReudsFratt92 | 2022-02-10 19:15


finally worked, but makes main.exe return errors that it wouldn’t if i run it in win explorer.

anyway, others, take note that OS.execute() runs file in project directory for some reason

ReudsFratt92 | 2022-02-10 19:25

:bust_in_silhouette: Reply From: SF123

Try doing:

OS.execute("D:\\Coding\\ascii\\dist\\main.exe", []) #<- make sure that you are properly escaping the backslashes.

Other than that go check out the documentation for OS.execute()

OS — Godot Engine (stable) documentation in English

thank you


works as well, though

ReudsFratt92 | 2022-02-10 19:33