1
私は機能があります。のpython3文字列変換の問題
def push(push):
ser.write(push + '\r')
pull = ser.read(11)
return pull
を、私はこのようにそれを呼び出す:
out = push("ka " + dp_id + " ff")
それはpython2で非常にうまく機能することが判明したが、私は、Python 3を使用するときに私が取得エラー:
:今、私はこれを行う場合unicode strings are not supported, please encode to bytes: 'ka 01 ff\r'
混乱し
can't concat bytes to str
イム:
out = push(b"ka " + display_id + " ff")
は、私はエラーを取得します。何が助けになるの?
ありがとうございました! – DildoShwagginz