K
K
KirSupi2022-03-27 02:50:14
go
KirSupi, 2022-03-27 02:50:14

How to run python script with timeout from Go?

There is a python script that takes a couple of parameters, but sometimes it takes too long.
You need to run this script from Go (and pass parameters to it), then, if it runs too long, you need to close it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WinPooh32, 2022-03-27
@KirSupi

The os/exec documentation even has an example for your case: https://pkg.go.dev/os/exec#example-CommandContext

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question