I am trying to send the user input, which is the 'ENTER' key and from the documentation looks like
I tried using
child.sendline()
should do the job. However the following code doesn't work. Could someone help me out?I tried using
child.sendline('y')
etc. as well but doesn't seem to be be sending anything back.import pexpect import re import sys command = f"telliot-examples -a {account} -sa {signature_account} report -pwd {password} -spwd {signature_password} -tx {tx_type} -pf {priority_fee} -p {profit} -mf {max_fee}" child = pexpect.spawn(command, encoding='utf-8', timeout=5) find_phrase = "Press [ENTER] to confirm settings." a = child.expect([re.escape(find_phrase)]) print(child.after) if child.after == find_phrase: print("here") # works child.sendline() # doesn't work else: print("The expected string was not found") sys.exit()