我是 python/repy 的新手。我正在尝试确定当前目录中的文件列表中是否存在字符串。这是我的代码。
def checkString(filename, string):
input = file(filename) # read only will be default file permission
found = false
searchString = string
for line in input:
if searchString in line:
found = true
break
if callfunc == 'initialize':
print listdir() #this will print list of files
for files in listdir():
checkString(files,"hello")
if found:
print "String found"
else:
print "String not found"
错误是什么,我该如何解决?
我在 Ubuntu 12.04 LTS 中运行它
Full debugging traceback:
"repy.py", line 448, in <module>
"repy.py", line 179, in main
"/home/hardik_darji/REPY/seattle/seattle_repy/virtual_namespace.py", line 78, in __init__
用户回溯:
Exception (with type 'exceptions.ValueError'): Code failed safety check! Error: ("<type 'exceptions.IndentationError'> expected an indented block (line 13)",)