我正在尝试运行此程序,但我的缩进是完全错误的。我不确定它们应该是什么:
import os.path
count = 1
for i in range(15):
fname = "/tmp/agent-" + str(count)+".txt"
if os.path.isfile(fname):
with open(fname, 'r') as content_file:
content = content_file.read()
print(content.rstrip())
count += 1
答案 0 :(得分:2)
我的猜测:
import os.path
count = 1
for i in range(15):
fname = "/tmp/agent-" + str(count)+".txt"
if os.path.isfile(fname):
with open(fname, 'r') as content_file:
content = content_file.read()
print(content.rstrip())
count += 1 # maybe, maybe not