Alson you can take a look at pexpect module if you want to automate logging in and process commands , in this way you will no longer wait for loginname and password prompt.