822 questions
0
votes
1
answer
68
views
How to make pexpect wait for full execution?
I'm using Python with pexpect to automate a script that builds a Docker image. The script takes about 20 minutes to complete.
Here's my current code:
child.sendline(f"./create_package_image.sh ...
1
vote
1
answer
69
views
Slow Execution of Pexpect Script - seems to be hitting 30s timeout each step
I am running the following script:
pxssh.PROMPT = "user@firewall>"
conn = pxssh.pxssh(options={
"StrictHostKeyChecking": "no",
"...
0
votes
2
answers
78
views
expect: make two python scripts communicate
I want to have two scripts communicating by exchanging messages. I have to use pexpect because of other restrictions. I am trying to make a minimal working example before I build it out for my ...
0
votes
0
answers
24
views
Seeing multiple connection error I am seeing with Pexpect
Describe the bug and reproduction steps
Getting multiple different errors while trying to log into a remote server server (From MacOS or Linux Rocky8).
could not set shell prompt (received: b"...
0
votes
0
answers
54
views
Python pexpect: Command only happens after subsequent commands are sent
Objective*
I am trying to use aws ecs execute-command in conjunction with pexpect.spawn() to start an interactive bash session in a container running on an EC2 instance.
Sample Code
import sys
import ...
0
votes
0
answers
109
views
Use Python interact with an interactive Bash session using the pty module
In (Debian) Linux I'd like to start an interactive Bash session and then pass it commands.
With my attempt it seems Bash isn't behaving as it would in a real terminal and abruptly stops during ...
0
votes
2
answers
116
views
How to keep Python pexpect shell open
I am trying to use pexpect to have a main processing loop that sends input to a number of other processes in order.
Code
pexpect_test.py
if __name__ == '__main__':
count = 3
processes = []
...
0
votes
0
answers
50
views
How does Python 3 use ‘pexpect’ to automatically interact with serial ports?
How to use Python ‘pexpect’ in Windows to automatically interact with a serial port (eg., COM3) and enter the user password when logging in to an embedded development board via serial port at power-on?...
0
votes
0
answers
41
views
Wexpect ssh authorization script
I have this code and it is not outputing anything and is not running the script
import wexpect
import sys
child = wexpect.spawn("ssh user@ip")
child.logfile = sys.stdout
child.expect("...
0
votes
0
answers
41
views
I'm on a linux box, trying to use pexpect.spawn to remote login to other linux boxes. But it looks like spawn and run disabled
I'm trying to use pexpect.spawn in a python script, but read on this forum that developers disabled spawn and run in pexpect module. I'm not using window, I'm trying to login from a linux box to other ...
1
vote
0
answers
28
views
Getting error with "pexpect.TIMEOUT" , while performing ssh with "pexpect.spawn" on multiple servers
I am trying to write a simple script, which ssh to individual servers switch user if required and execute command. However i am not able to make it work even after lot of try.
Any help will be really ...
0
votes
0
answers
27
views
Unable to use pexpect.sendline for more than 8000 seconds
There is timeout keyword variable for sendline function in pexpect, I wanted to run my script to wait for response even for almost 2 days, for which I am trying to give timeout=43200 but my child ...
1
vote
0
answers
34
views
Getting Error while using pexpect: TypeError: 'spawn' object is not subscriptable
I am trying to write a python code with pexpect, to login into multiple servers and run commands such as "ls".
below is my code:
import getpass
import pexpect
import sys
def get_credential():...
-1
votes
1
answer
72
views
Pass Multiple Inputs to Terminal Command Python
I have this terminal command I need to run programmatically in Python:
awssaml get-credentials --account-id **** --name **** --role **** --user-name ****
It will first ask for your password, and then ...
1
vote
1
answer
84
views
Python - check for specific shell prompt on a remote server
Is there a way, using Python, to check for a specific command prompt on a remote Unix server. I need to be able to SSH to a series of remote Unix servers, check that I receive a "INPUT NAME:&...