擅长:python、mysql、java
<p><code>vt_result_file</code>仅作为<code>vt_result_check</code>的<strong>局部</strong>变量存在,您的错误是说该变量不存在于文件的底部。在</p>
<p>另外,(即使这无关紧要)在调用创建变量的函数之前,您引用的是该变量。在</p>
<hr/>
<p>在主功能区没有任何循环。而您的<code>check</code>函数只返回一个值。在</p>
<p>因此,您只能写出一个CSV行</p>
<pre><code>if __name__ == '__main__':
with open(file_n, 'w') as output:
writer = csv.writer(output)
writer.writerow([file_n, vt_result_check(path)])
</code></pre>
<hr/>
<p><strong>编辑</strong></p>
<p>关于你的评论,你想要这样的东西</p>
^{pr2}$