Switch between interactive and non-interactive mode in pexpect
问题 I am using pexpect to upload a file to SFTP server. For accesssing the server first time, I get message as The authenticity of host..can't be established.Are you sure you want to continue connecting (yes/no)? to which I want the user to interact and answer yes/no. However, when user says yes, I want the interactive mode to be off and then take the password from my script instead of prompting user. Is this possible using pexpect ? p = spawn('XXXXXXXX') password = 'XXXXXXXXx' out=p.expect(['(?i