Skip to content

Instantly share code, notes, and snippets.

@ucalyptus2
Created June 26, 2020 03:44
Show Gist options
  • Save ucalyptus2/7c7b12426d45704020ccb907e5e13682 to your computer and use it in GitHub Desktop.
Save ucalyptus2/7c7b12426d45704020ccb907e5e13682 to your computer and use it in GitHub Desktop.
# coding: utf-8
"""
@Author: Sayantan Das
@Github: ucalyptus
"""
import ftplib
uid = 'ucalyptus'
pwd = 'saddad1998'
def download(filename):
session = ftplib.FTP('ftp.drivehq.com',uid,pwd)
handle = open(filename,'wb')
session.retrbinary('RETR '+filename,handle.write)
handle.close()
session.quit()
print('Downloaded Successfully')
def upload(filename):
session = ftplib.FTP('ftp.drivehq.com',uid ,pwd)
fil = open(filename,'rb')
session.storbinary('STOR '+filename,fil)
fil.close()
session.quit()
print('Uploaded Successfully')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment