File: timeout.py

package info (click to toggle)
python-expect 1.0.5-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 320 kB
  • ctags: 122
  • sloc: ansic: 1,206; sh: 468; python: 157; makefile: 58
file content (13 lines) | stat: -rwxr-xr-x 271 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/python

# demonstrate the timeout method:

import sys, time
from expect import *

f = popen ("echo 'start' ; sleep 1 ; echo 'lap1' ; \
sleep 2 ; echo 'lap2' ; sleep 3 ; echo 'lap3' ; sleep 4 ; echo 'lap4'")
f.settimeout (3.5)
while 1:
    print f.read ("\n")