我可以通过内容搜索文件,但是如何将找到的文件发送到ftp,使用密码和登录名c的ftp?
import os
import urllib.request
rootdir=('/home/user/file')
for folder, dirs, files in os.walk(rootdir):
for file in files:
if file.endswith('.XML'):
fullpath = os.path.join(folder, file)
with open(fullpath, 'r') as f:
for line in f:
if "Seller" in line:
print(fullpath)
break