1 Star 0 Fork 45

michaelssj/qytang_Python

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
2016.02.10 ftp putfile 454 Bytes
Copy Edit Raw Blame History
现任明教教主-乾颐堂 authored 2016-02-10 10:23 . new file
import ftplib
def putfile(file, site, dir, user=(), *, verbose = True):
if verbose:print('Uploading', file)
local = open(file, 'rb')
remote = ftplib.FTP(site)
remote.login(*user)
remote.cwd(dir)
remote.storbinary('STOR ' + file, local, 1024)
remote.quit()
local.close()
if verbose: print('Upload done.')
if __name__ == '__main__':
site = '172.17.100.205'
dir = '.'
putfile('ftp.py', site, dir, user=('labtest', 'xxxx'))
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/michaelssj/qytang_Python.git
git@gitee.com:michaelssj/qytang_Python.git
michaelssj
qytang_Python
qytang_Python
master

Search