Skip to content

Commit

Permalink
Update Readme based on #44
Browse files Browse the repository at this point in the history
  • Loading branch information
raczben committed Feb 1, 2021
1 parent b0d4abd commit 03499c7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ To interract with a child process use `spawn` method:

```python
import wexpect

prompt = '[A-Z]\:.+>'

child = wexpect.spawn('cmd.exe')
child.expect('>')
child.sendline('ls')
child.expect('>')
print(child.before)
child.expect(prompt) # Wait for startup prompt

child.sendline('dir') # List the current directory
child.expect(prompt)

print(child.before) # Print the list
child.sendline('exit')
```

Expand Down

0 comments on commit 03499c7

Please sign in to comment.