May-21-2019, 11:58 AM
I am reading up/watching videos and am taking my first baby steps with pexpect.
I expected (wrongly) that the sequence below would work.
That is I would spawn a process to ssh to the defined host.
Is "expect" really not defined within the said module?
Appreciate any help....
blah@xxxxx3:~$ python
Python 2.7.12 (default, Nov 12 2018, 14:36:49)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import pexpect
>>> p = expect.spawn("ssh xxx-xxx-7")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'expect' is not defined
>>>
I expected (wrongly) that the sequence below would work.
That is I would spawn a process to ssh to the defined host.
Is "expect" really not defined within the said module?
Appreciate any help....
blah@xxxxx3:~$ python
Python 2.7.12 (default, Nov 12 2018, 14:36:49)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import pexpect
>>> p = expect.spawn("ssh xxx-xxx-7")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'expect' is not defined
>>>