[UDT] update README to python-3

This commit is contained in:
Benedek Racz 2019-05-05 17:54:10 +02:00
parent a5815fa4a8
commit be5fa58a0e

View File

@ -5,20 +5,26 @@
*Pexpect* is a Python module for spawning child applications and controlling *Pexpect* is a Python module for spawning child applications and controlling
them automatically. them automatically.
**!! UPDATE !!**
I'm glad to announce that python-3 is supported form version 2.3.3
## **Install** ## **Install**
pip install wexpect pip install wexpect
Note that only python 2.x is supported.
## **Usage** ## **Usage**
To interract with a child process use `spawn` method: To interract with a child process use `spawn` method:
child = pexpect.spawn('C:\Windows\System32\cmd.exe') ```python
child.expect('>') import wexpect
child.sendline('ls') child = wexpect.spawn('cmd.exe')
child.expect('>') child.expect('>')
child.sendline('ls')
child.expect('>')
print(child.before)
```
For more information see [examples](./examples) folder. For more information see [examples](./examples) folder.
@ -50,9 +56,7 @@ This repo tries to fix these limitations, with a few example code and pypi integ
--- ---
## Installation and limitation of wexpect ## Installation of wexpect
Current version does *not* work on python-3.x. You need to use **python 2.x** to use wexpect.
### Standard installation ### Standard installation
@ -68,4 +72,14 @@ good enough instead of installing. However in this case you need to install manu
One (non stanbdard) package, **pypiwin32** is needed by wexpect. One (non stanbdard) package, **pypiwin32** is needed by wexpect.
pip install pypiwin32 pip install pypiwin32
---
## Dev
Thanks for any contributing!
To run test, enter into the folder of the wexpect's repo then:
`python -m pytest tests`