0 votes

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?

in Engine by (64 points)

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:https://imgur.com/a/ZwaRPEL

2 Answers

0 votes
Best answer

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()

https://docs.godotengine.org/en/stable/classes/class_os.html#class-os-method-execute

by (231 points)
selected by

thank you

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

works as well, though

–1 vote
OS.execute('shell_command', [])
by (1,636 points)
edited by

I tried

func _ready():
    OS.execute("D://Coding/ascii/dist/main.exe")

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

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

doesn't return error, but neither executes the file

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

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

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.