Created
June 26, 2020 03:44
-
-
Save ucalyptus2/7c7b12426d45704020ccb907e5e13682 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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