#!/usr/bin/python
try:
f = open("/home/masi/r.raw", "r+")
aBuf = f.seek(4)
except:
print "Error at position : ", position
events = []
for i in range(100):
aBuf = f.seek(4);
try:
if aBuf[:4] == b'\xFA\xFA\xFA\xFA':
print("E")
except:
# print "\0"
f.close()当我注释掉out的打印时,我会得到错误。
f.close()
^
IndentationError: expected an indented block我想我需要试一试--除了if-子句经常是错误的。
为什么我会得到这个意想不到的缩进?
发布于 2015-07-09 13:11:07
事件= []和向下的代码需要在第一个try..except块中。f.close()超出了范围。
https://stackoverflow.com/questions/31318458
复制相似问题