Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #!/usr/bin/python
  2. import sys, os, time, pexpect
  3. try:
  4. child = pexpect.spawn('microcom -p /dev/ttyUSB0 -s 115200', timeout=10)
  5. child.logfile = sys.stdout
  6. child.sendline('start')
  7. result=child.read().find("starting kernel")
  8. if result >=0:
  9. print "success!"
  10. else:
  11. print "failed!"
  12. child.expect('done')
  13. except:
  14. print "Error"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement