Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pexpect module first step
#1
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
>>>
Reply


Messages In This Thread
Pexpect module first step - by slouw - May-21-2019, 11:58 AM
RE: Pexpect module first step - by buran - May-21-2019, 12:19 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Reading and storing a line of output from pexpect child eagerissac 1 4,326 Feb-20-2024, 05:51 AM
Last Post: ayoshittu
  Import a module one step back of the path prathampatel9 1 1,108 Sep-21-2022, 01:34 PM
Last Post: snippsat
  Use pexpect to send user input alisha17 0 1,939 May-10-2022, 02:44 AM
Last Post: alisha17
  Not able to read the text using pexpect/expect Bipinjohnson 7 4,132 Jan-10-2022, 11:21 AM
Last Post: Bipinjohnson
  Sudden Problem with pexpect gw1500se 3 2,445 Nov-19-2021, 11:21 PM
Last Post: bowlofred
  How to use pexpect in python? tiho_bg 1 1,557 Oct-30-2021, 02:50 PM
Last Post: Yoriz
  Pexpect timesout before executing whole output eagerissac 0 1,532 Jun-23-2021, 03:30 AM
Last Post: eagerissac
  pexpect startup help korenron 2 3,526 Apr-27-2021, 07:23 AM
Last Post: korenron
  Problem with pexpect.exception.TimeOUT korenron 0 3,347 Apr-12-2021, 03:25 PM
Last Post: korenron
  Request help on pexpect rsurathu 4 5,874 Jul-19-2020, 03:35 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020