So I'm trying to interact with a .exe file (tcpclient.exe) and pexpect docs show that it is perfect since I need to send multiple inputs and interact with the program.
But I cant even get the following code to work
import wexpect
child = wexpect.spawn('dir')
print child
I'm assuming any variable can be print()ed provided the function was valid.
The following is the error message
Traceback (most recent call last):
File "test1.py", line 13, in <module>
child = wexpect.spawn('dir')
File "C:\pytest\wexpect.py", line 279, in spawn
return spawn_windows(command, args, timeout, maxread, searchwindowsize, logfile, cwd, env)
File "C:\pytest\wexpect.py", line 1653, in __init__
self._spawn (command, args)
File "C:\pytest\wexpect.py", line 1698, in _spawn
raise ExceptionPexpect ('The command was not found or was not executable: %s.' % self.command)
ExceptionPexpect: The command was not found or was not executable: dir.
I am using windowsXP I have MinGW installed and Python2.7 I am using wexpect through the pywin32 package
pywin32-217.win32-py2.7.exe that was the installation .exe name.
My Python path is set as C:\Python27\ I tried setting it to C:\Python27\bin as someone mentioned but then I couldnt execute python after that. I looked into the source code for wexpect and there is a function "which()" which is returning "None" to its input "dir" I was unable to modify it to do otherwise.
Please tell me what I did wrong.
Thanks in Advance.