I'm making a go program which has a feature to get the log from a program, so I need to get the output from a command without the program exiting.
For testing purposes, this is my program (idk if relevant, but) ```py
import time
for x in range(15):
print(x)
time.sleep(1)
For running it, I've tried, but with no success ```go
var cmd = exec.Command("python", "ex.py")
out, err := cmd.Output()
if err != nil {
println(err.Error())
return
}
```, which just waits for it to exit. I've also tried ```go
var cmd = exec.Command("python", "ex.py")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Run()
```, but that just outputs it to terminal, which is good, but I want to set it to an array/string as it outputs