[問題] pyserial delete 0x7f變成backspace 0x08
我的目的是在serial port中輸入Delete鍵,但是失敗了。
autoboot in 3 seconds (stop with 'Delete' key)...
看到這串字時,按下Delete鍵
這是我的python/pyserial版本
python 3.4.2
pyserial 3.3
Code:
import serial
sp = serial.Serial(serial_port, 115200, timeout=0.5)
sp.write(b'\x7f')
我做個實驗,我用vi寫入一串字,然後游標移到中間
0x7f = 127 = DEL
發現輸入DEL實際上的行為卻變成backspace BS(0x08)
請問我是哪裡有寫錯嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 101.138.125.113
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1519961450.A.F71.html
※ 編輯: subset (101.138.125.113), 03/02/2018 11:33:03
→
03/02 21:14,
7年前
, 1F
03/02 21:14, 1F
→
03/02 22:28,
7年前
, 2F
03/02 22:28, 2F
→
03/02 22:29,
7年前
, 3F
03/02 22:29, 3F
→
03/05 08:37,
7年前
, 4F
03/05 08:37, 4F
→
03/05 08:38,
7年前
, 5F
03/05 08:38, 5F
Python 近期熱門文章
PTT數位生活區 即時熱門文章