diff options
author | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2002-03-05 01:12:29 +0000 |
---|---|---|
committer | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2002-03-05 01:12:29 +0000 |
commit | fc9eb38aeee0e9505d98d7fea564ca5b7aa0e6d8 (patch) | |
tree | aaca161b4f48434b99f7b75b70bdd8e84ef3fd42 /pyserial/examples/miniterm.py | |
parent | d441974732faba5fa7a7f572cf6a7df3b3c6d035 (diff) | |
download | pyserial-git-fc9eb38aeee0e9505d98d7fea564ca5b7aa0e6d8.tar.gz |
added new example
Diffstat (limited to 'pyserial/examples/miniterm.py')
-rw-r--r-- | pyserial/examples/miniterm.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pyserial/examples/miniterm.py b/pyserial/examples/miniterm.py index 829a454..43b4fa8 100644 --- a/pyserial/examples/miniterm.py +++ b/pyserial/examples/miniterm.py @@ -1,8 +1,10 @@ #!/usr/bin/env python #very simple serial terminal +#(C)2002 Chris Liechti >cliecht@gmx.net> + #input characters are sent directly, received characters are displays as is -#baudrate and echo configuartion is done through globals: +#baudrate and echo configuartion is done through globals import sys, os, serial, threading, getopt @@ -10,7 +12,7 @@ import sys, os, serial, threading, getopt EXITCHARCTER = '\x04' #ctrl+d #first choosea platform dependant way to read single characters from the console -if os.name == 'nt': #sys.platform == 'win32': +if os.name == 'nt': import msvcrt def getkey(): while 1: @@ -52,7 +54,7 @@ def reader(): sys.stdout.write(s.read()) def writer(): - """loop forever and copy console->serial""" + """loop and copy console->serial until EOF character is found""" while 1: c = getkey() if c == EXITCHARCTER: break #exit on esc |