したがって、このコードのチャンクを個別に記述すると正常に動作しますが、それらを組み合わせると typeError が発生します。なぜこれが起こるのですか?それらを別々に書いたときにはうまくいきません。前もって感謝します :)
def printOutput(start, end, makeList):
if start == end == None:
return
else:
print start, end
with open('OUT'+ID+'.txt','w') as outputFile:#file for result output
for inRange in makeList[(start-1):(end-1)]:
outputFile.write(inRange)
with open(outputFile) as file:
text = outputFile.read()
with open('F'+ID+'.txt', 'w') as file:
file.write(textwrap.fill(text, width=6))