这一节首次提到了target,是什么意思呢,用来做什么的?
print("Truncating the file . Goodbye!")
target.truncate()
60岁小学学历自学python中,很难理解一些概念唉。
target在这里不过是个变量名字,你好好读一读上下文,看把什么东西赋值给它了
target被赋值为一个文件对象,target.truncate()是对文件内容进行截断。
建议你看一下:
https://www.runoob.com/python/file-truncate.html