pexpect

SCP a tar file using pexpect

Hello, I am using ssh to log into a camera, scp a tarball over to it and extract files from the tarbal and then run the script. I am having problems with Pexpect, though. Pexpect times out when the tarball is being copied over. It seem's not to wait until it is done. And then it start's doing the same thing with the untar command, The c...

How to simulate re.findall for pexpect in python?

Is it possible to simulate re.findall in the pexpect module? I currently have a script that ssh's into a server using pexpect. I then have it send a command to the server which returns a bunch of lines in p.before (p being a pexpect spawn): JUNK JUNK JUNK IP ADDRESS 10.0.0.1 JUNK JUNK JUNK IP ADDRESS 10.0.0.3 JUNK JUNK JUNK JUNK JUNK J...

pexpect timeout is not being used, only the default of 30 is being used.

I'm trying to do a lengthy operation but pexpect with the timeout argument doesn't seem to change the length of time before the timeout exception gets fired. Here is my code: child = pexpect.spawn('scp file user@:/temp', timeout=300) whichMatched = child.expect(['(?i)Password','Are you sure you want to continue connecting (yes/no)?'], ...

using Python/Pexpect to crawl a network

Hi. This is more a logical thinking issue rather than coding. I already have some working code blocks - one which telnets to a device, one which parses results of a command, one which populates a dictionary etc etc Now lets say I want to analyse a network with unknown nodes, a,b,c etc (but I only know about 1) I give my code block node...

PEXPECT with HOWIE (pyaiml chat bot) to make OBJECTIVE C gui to replace terminal

So I want to make a nice objective c GUI for HOWIE. Can someone show me how to use PEXPECT to communicate with howie? I don't want to use terminal, I want to use my gui as the interface. ...

regex for scp using pexpect

Hi, I'm using Pexpect to scp and get some files from a remote Linux machine. The script is run from a Linux machine and I'm unable to come to conclusion about the correct regex expression for the prompt which includes an IP.The SCP transfer works fine if IP is hardcoded. It generally looks like: [email protected]'s password: For t...

What can Expect do that Pexpect can not do?

Hello I am considering to start using Pexpect. On Pexpects homepage I find this: Q: Why not just use Expect? A: I love it. It's great. I has bailed me out of some real jams, but I wanted something that would do 90% of what I need from Expect; be 10% of the size; and allow me to write my code in Python instead of TC...

How to control links2 with Python

How can I execute links2 to open a web page and locate and click a text link with Python? Is pexpect able to do it? Any examples are appreciated. ...

Using pexpect to listen on a port from a virtualbox

Hi all, I am trying to create a tcplistener in python (using pexpect if necessary) to listen for tcp connection from Ubuntu in virtualbox on a windows xp host. I would really appreciate it, if one of you could point me in the right direction. Thank you. P.S: I have limited experience in the area, any help would be welcome. ...

Pexpect - silence ssh connection output

Hi. I'm using a simple pexpect script to ssh to a remote machine and grab a value returned by a command. Is there any way, pexpect or sshwise I can use to ignore the unix greeting? That is, from child = pexpect.spawn('/usr/bin/ssh %s@%s' % (rem_user, host)) child.expect('[pP]assword: ', timeout=5) child.sendline(spass) ...