'Executing a python script from Golang with arguments
I am trying to execute a python script ( which is used for accessing remote machines and run commands ) from Golang, it errors with "exit status 2"
out, err := exec.Command("/usr/local/opt/bin/python3.7", "/users/test.py -i 12.13.14.15 --cmd \"uptime && date\"").Output()
if err != nil {
fmt.Printf("%s", err)
} else {
fmt.Println("Command Successfully Executed")
output := string(out[:])
fmt.Println(output)
}
Output
exit status 2
thank you.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
