int
is not a str
, so convert it to a string first:
dec_list.append(int(str(rmsg[x]), 2))
It is much more Pythonic to use a list comprehension instead of a for-loop like that, though:
dec_list = [int(str(c), 2) for c in rmsg]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…