📄 uart_terminal.py
字号:
import sysimport serialimport threadingdef copy_file_forever(fout, fin): while 1: fout.write(fin.read(1)) fout.flush()s = serial.Serial(port='/dev/tty.usbserial0', baudrate=19200, bytesize=8, parity=serial.PARITY_NONE, stopbits=1)reader_thread = threading.Thread( target=lambda : copy_file_forever(sys.stdout, s))writer_thread = threading.Thread( target=lambda : copy_file_forever(s, sys.stdin))reader_thread.start()writer_thread.start()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -