Comments (2)
Hi,
- Can you run the example script from the README with success?
import wexpect
prompt = '[A-Z]\:.+>'
child = wexpect.spawn('cmd.exe')
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')
-
(I have not used this,
mysql_install_db
, so I don't know how should it work...) Does your program (c:\mysql\bin\mysql_install_db.exe --service=comerzzia-mysql --password=admincmz --innodb_page_size=16K
) returns with the CMD's prompt (C:\Your\path>
) when you run it without expect? Note, that ifmysql_install_db
does not finish, and returns the prompt, wexpect won't find matching for the prompt regex.
Ifmysql_install_db
does not finishes the run you have to replace the given prompt expression withmysql_install_db
's internal prompt. -
Do you plan to interact with
mysql_install_db
? I mean, if you just want to run it and check the return value and the stdout, I suggest using python's built insubprocess.check_output
. (However, if you plan to send commands to it, you should use expect) (Again, I don't knowmysql_install_db
) -
How long does
mysql_install_db
run? (wexpect default timeout is 30 sec.)
from wexpect.
- The example works well. The issue is with the iterator.
- It executes a MySQL clean installation. Yes, it finish and return the prompt.
- Interact is needed
- 10 secs, aprox
from wexpect.
Related Issues (20)
- How to get the matching print? HOT 1
- Always TIMEOUT HOT 3
- always get Error: no spawn class: {spawn_class_name} when import wexpect HOT 1
- Fix hello_wexpect HOT 2
- Can't work with windows's ssh client? HOT 1
- Asyncio support
- wexpect throw UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe5 in position 2999: unexpected end of data HOT 1
- spawn hangs when run in virtual environment HOT 4
- Critical Performance Issue HOT 2
- pywintypes.error: (2, 'CreateFile', '系统找不到指定的文件') HOT 1
- logfile parameter not working in version 4.0.0 HOT 1
- Port overload when running multiple instances leads to timeout
- Stuck in loop trying to initialize pipe HOT 3
- Update testcases to work for Windows + write them in pytest
- command_with_path = shutil.which(self.command) breaks Windows command support
- Function of sendeof in Windows
- running too slow HOT 1
- wexpect.spawn(echo=False) is not work and setecho(False) is raise the "AttributeError: 'SpawnPipe' object has no attribute 'setecho'" exception.
- Can't get output of "dir" command on Windows HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wexpect.