纯wxpython中一种简单的跨平台串行终端
wxTerminal的Python项目详细描述
许可证: bsd,请参见readme.txt
更改: | 1.1原始版本 | 1.2增加“后门”插座服务器 | 1.3 TX和RX上的分离新线转换 | 1.4增加了对csfifo的依赖性
用法:
我在windows xp、windows 7和linux/ubuntu上用python 2.6.7和2.7.3测试过它,但是没有给出它正确运行的保证。它可能适用于较旧的python版本和其他操作系统。
它现在支持一个socket服务器,因此您可以通过tcp远程连接到它。
port参数现在支持来自pyserial的url,例如
port=socket://localhost:12345
从命令行:
usage: wxTerminal.py [-h] [-port PORT] [-baud BAUD] [-xon] [-rts] [-timeout TIMEOUT] [-echo] [-D] [-KBNONE | -KBCR | -KBLF | -KBCRLF | -KBLFCR] [-SPNONE | -SPCR | -SPLF | -SPCRLF | -SPLFCR] [-5 | -6 | -7 | -8] [-stop {1,1.5,2}] [-None | -Odd | -Even | -Mark | -Space] [-snoopserver] [-lockKB]
e.g. wxTerminal.py -h wxTerminal.py <PORT> [other settings] Simply wxTerminal.py on it's own pops up a configuration dialog
来自python:
import wxTerminal wxTerminal.Terminal(port="/dev/ttyS0") #Will open /dev/ttyS0 with default settings
或
import wxTerminal t=wxTerminal.Termina(port="/dev/tyUSB0",baudrate=115200,snoopserver=True)
或
import wxTerminal wxTerminal.Terminal() #Will bring up a port setup dialog
其他关键字参数:
baudrate Sets the serial baud rate bytesize Sets size of Tx/Rx serial characters parity Sets serial parity stopbits Sets number of stop bits rtscts Enables hardware flow control xonxoff Enables software flow control timeout Alters serial timeout echo Enables local echo unprintable TBD sp_newline Inbound newline translation kb_newline Outbound newline translation snoopserver Enable a telnet server (port 56712) PortSettings A dictionary with keys/values from the above list lockKB Lock keyboard input (useful for snooped connections)
依赖关系:
wxPython pySerial Python >2.6.3 csFIFO