Skip to content

Instantly share code, notes, and snippets.

@detly
Created March 30, 2015 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save detly/490f8f0cd2508ee30a49 to your computer and use it in GitHub Desktop.
Save detly/490f8f0cd2508ee30a49 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import sys
import pexpect
def callback(state):
data = state['child'].before + state['child'].after
print("Got: {:s}".format(repr(data)))
def main():
cmd = ' '.join([
sys.executable,
'pexpect_bug_script.py'
])
output, status = pexpect.run(
cmd,
events={'\r': callback}
)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment