Is it possible to initiate another process from a godot game

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

I’m trying to determine is I’ll be able to do what I have in mind with gdscript. I’m interested in writing puzzle games, somewhat like mahjong solitaire. When there is a new random deal, I want to call a computationally intensive process to solve the game, so that if the user asks to see the solution, it will be ready. In python, I would use the subprocess module to accomplish this. I already have the solver written in C, and it would be a lot of work to port it to another language. I can do what I want in python, using tkinter, but the graphics aren’t any good.

Is there a facility to do what I want if I adopt godot, either with gdscript or in some other fashion?

:bust_in_silhouette: Reply From: Calinou

You can use OS.execute() for that. Keep in mind you can only access the program’s output if it’s running in blocking mode (which means the rendering will freeze until the process is done running, unless you are executing it from a thread).

That’s what I needed to know. Thanks.

saulspatz | 2018-11-03 18:59