Skip to main content
Filter by
Sorted by
Tagged with
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 ...
Ronny's user avatar
  • 3
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", "...
Logan's user avatar
  • 11
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 ...
Mikkel Rev's user avatar
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"...
Kailash Prabhu's user avatar
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 ...
Cogito Ergo Sum's user avatar
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 ...
suuudooo's user avatar
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 = [] ...
Cogito Ergo Sum's user avatar
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?...
user-cloud123's user avatar
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("...
Шрек's user avatar
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 ...
Zadaman's user avatar
  • 11
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 ...
bprat3's user avatar
  • 23
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 ...
Sandeep kumpaty's user avatar
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():...
bprat3's user avatar
  • 23
-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 ...
ez4nick's user avatar
  • 10.2k
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:&...
Chris Boone's user avatar

15 30 50 per page
1
2 3 4 5
55