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 getting the following error:
C:\Users\Administrator\PycharmProjects\testProject\venv\Scripts\python.exe
C:/Users/Administrator/PycharmProjects/testProject/test.py
Traceback (most recent call last):
File "C:/Users/Administrator/PycharmProjects/testProject/test.py", line 3, in <module>
child.send('dir')
File "C:\Users\Administrator\PycharmProjects\testProject\venv\lib\site-packages\wexpect.py", line
1810, in send
c = self.wtty.write(s)
File "C:\Users\Administrator\PycharmProjects\testProject\venv\lib\site-packages\wexpect.py", line
2128, in write
wrote = self.__consin.WriteConsoleInput(records)
**pywintypes.error: (6, 'WriteConsoleInput', 'The handle is invalid.')**
Process finished with exit code 1
please advise