Skip to main content
Filter by
Sorted by
Tagged with
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
1 vote
4 answers
1k views

How to write a code to get another python script output that require an input

I want to give score to several python scripts written by different people and i want to automate the answer check since the given question is same. So we send an input to another python file, we get ...
Yusuf Syam's user avatar
1 vote
1 answer
452 views

wexpect equivalent for logging

I have the following codes using pexpect in linux it is ok. import pexpect child = pexpect.spawn('ssh test@ip' % (susername, ip) , encoding='utf-8') child.logfile = open("{}/{}.txt".format(...
Andy's user avatar
  • 11
1 vote
1 answer
494 views

Wexpect in a Python Virtual Environment

When run in cmd window, the spawn command works fine, but if in a virtual environment, it hangs forever. This works C:\Users\csullivan\Documents\Projects\netlog>python Python 3.9.5 (tags/v3.9.5:...
Deepstop's user avatar
  • 3,837
4 votes
1 answer
821 views

Wexpect freezes at spawn() method

When I run the example code from wexpect, it freezes on the spawn method. import wexpect prompt = '[A-Z]\:.+>' child = wexpect.spawn('cmd.exe') child.expect(prompt) # Wait for startup prompt ...
Domin's user avatar
  • 41
0 votes
1 answer
2k views

How do I get wexpect to interact a python script?

Folks, I would like to know if there is an issue w/ wexpect. Is this module working as expected? things seem to work as expected in pexpect on linux import wexpect child = wexpect.spawn('cmd') child....
Sblu's user avatar
  • 53
1 vote
1 answer
562 views

Problems when trying to use wexpect for controlling sub-process

i'm trying to use wexpect on windows machine, and facing issues in the very basic operations. i'm running the following command: import wexpect child = wexpect.spawn('cmd.exe') child.send('dir') and ...
Moish's user avatar
  • 11
1 vote
2 answers
3k views

Running wexpect on windows

I have installed wexpect on Windows 7. Now, when I am trying to run any command, I am getting the below error. I am using MKS toolkit, so ls is a valid command. >>> import pexpect >>&...
sarbjit's user avatar
  • 3,915
2 votes
3 answers
7k views

run an executable using wexpect

I have an executable (evapo.exe) which has to be called with an input file (inputs.prj), usually I do it using windows command prompt by just typing c:\myfiles\evapo inputs.prj (of course both the ...
Eric Gentil's user avatar
1 vote
3 answers
5k views

How to install wexpect?

I'm running 32-bit Windows XP and trying to have Matlab communicate with Cgate, a command line program. I'd like to make this happen using wexpect, which is a port of Python's module pexpect to ...
Justine's user avatar
  • 31