I am using client.exec_command
to run several commands consecutively but seems it's non-blocking. Sometimes I want to wait for a command to finish before running the next one. I know I can utilize a channel's API chan.exec_command
and wait on it's exit status, which works but the channel closes after running the command and I have to start a new channel each time for the next command. What I'm looking for is some clean solution that run multiple commands consecutively and wait on each one, just like how a person doing it manually.
New to Python too. Any comment is welcome. Thanks.