diff options
author | Guido van Rossum <guido@python.org> | 1996-07-22 15:23:25 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-07-22 15:23:25 (GMT) |
commit | 5c971677a5433aff7c1150e39bde222c24c26f39 (patch) | |
tree | 64d0b425bebe8c8a74d6ce51bc4a61817ef388f9 /Lib/dos_8x3/test_sel.py | |
parent | ad8b3baa919f5ab1201fca0e608905851f24e967 (diff) | |
download | cpython-5c971677a5433aff7c1150e39bde222c24c26f39.zip cpython-5c971677a5433aff7c1150e39bde222c24c26f39.tar.gz cpython-5c971677a5433aff7c1150e39bde222c24c26f39.tar.bz2 |
Fuck. For PC support, this must be in the distribution.
Diffstat (limited to 'Lib/dos_8x3/test_sel.py')
-rwxr-xr-x | Lib/dos_8x3/test_sel.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Lib/dos_8x3/test_sel.py b/Lib/dos_8x3/test_sel.py new file mode 100755 index 0000000..f185308 --- /dev/null +++ b/Lib/dos_8x3/test_sel.py @@ -0,0 +1,23 @@ +# Testing select module + +def test(): + import select + import os + cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do date; sleep 3; done' + p = os.popen(cmd, 'r') + for tout in (0, 1, 2, 4, 8, 16) + (None,)*10: + print 'timeout =', tout + rfd, wfd, xfd = select.select([p], [], [], tout) + print rfd, wfd, xfd + if (rfd, wfd, xfd) == ([], [], []): + continue + if (rfd, wfd, xfd) == ([p], [], []): + line = p.readline() + print `line` + if not line: + print 'EOF' + break + continue + print 'Heh?' + +test() |