source: fact/trigger/test.py@ 10058

Last change on this file since 10058 was 52, checked in by rissim, 16 years ago
trigger software (VME) v1
  • Property svn:executable set to *
File size: 417 bytes
Line 
1#!/usr/bin/python
2import sys, os, select, time
3
4i = 0
5
6def getInput():
7 input = ''
8 while len(select.select([sys.stdin.fileno()], [], [], 0.0)[0])>0:
9 input += os.read(sys.stdin.fileno(), 4096)
10 return input
11
12def doWork():
13 global i
14 time.sleep(0.5)
15 i += 1
16
17if __name__=='__main__':
18 input = ''
19 while not input:
20 doWork()
21 input = getInput()
22 print "got user input: %r" % input
23 print "did %d units of work" % i
Note: See TracBrowser for help on using the repository browser.