擅长:python、mysql、java
<p>“该文件”指的是您试图上载到FTP的文件。根据您的代码,它引用以下行:<code>myfile = '/Users/mnewman/Desktop/requested.txt'</code>。出现此错误是因为Python在路径中找不到文件。检查它是否存在于正确的路径中。如果要测试脚本中是否存在错误,可以将测试文件添加到Python脚本所在的目录中,然后使用该文件的路径运行脚本</p>
<p>FTP上载的示例脚本:</p>
<pre class="lang-py prettyprint-override"><code>import ftplib
session = ftplib.FTP('ftp.example.com','user','password')
file = open('hello.txt','rb') # file to send
session.storbinary('STOR hello.txt', file) # send the file
file.close() # close file and FTP
session.quit()
</code></pre>