它说:
TABERROR
File "(Path)\DETS.PY",
line 271
res = (int(res, 2))
我有:
代码:
def uncode(list,line):
file = open(list+'.txt','r')
temp = ''
res = ''
if line >= 3:
for i in range(1,line):
file.readline()
elif line == 2:
file.readline()
for i in file.readline():
temp = temp + i
if len(temp) == 2:
res = res + trans[temp]
temp = ''
**res = (int(res, 2))**
return res
def uncode2(list,line):
fffiile = open('a'+list+'.txt','r')
temp = ''
res = ''
if line >= 3:
for i in range(1,line):
fffiile.readline()
elif line == 2:
fffiile.readline()
for i in fffiile.readline():
temp = temp + i
if len(temp) == 2:
res = res + temp
temp = ''
res = (int(res, 2))
return **res**
答案 0 :(得分:3)
我有:
- 用4个空格替换所有标签,
- 检查地点是否真的有4个空格,
我的文字编辑建议你错过了两个地方。圆点表示空格,箭头表示标签。
我猜你确认每行开始有空格,但随后错过了任何不在文件左边缘的标签字符。