]>
Commit | Line | Data |
---|---|---|
1 | ||
2 | ||
3 | """ | |
4 | This is a simple little echo program that is used by the wxProcess | |
5 | demo. It reads lines from stdin and echos them back to stdout, until | |
6 | there is an EOF on stdin. | |
7 | ||
8 | Enter text in the field below to send to the stdin of the echo | |
9 | process. Clicking on 'Close Stream' will close the stream in the | |
10 | demo, and then echo.py should terminate too... | |
11 | """ | |
12 | ||
13 | import sys | |
14 | ||
15 | sys.stdout.write( __doc__) | |
16 | sys.stdout.flush() | |
17 | ||
18 | line = sys.stdin.readline() | |
19 | while line: | |
20 | line = line[:-1] | |
21 | sys.stdout.write('\nYou typed "%s"\n' % line) | |
22 | line = sys.stdin.readline() | |
23 | ||
24 | ||
25 | sys.stdout.write('\nExiting...\n') |