You can also download and install PyTransmit directly from the Python Package Index
using either pip or easy_install:

pipinstallPyTransmiteasy_install-ZPyTransmit

If you prefer, you can also simply place the pytransmit subdirectory somewhere on
your python path. This is useful if you are running the latest version from
Mercurial, or want to deploy pytransmit with your application on for example Google
App Engine.

app_root=os.path.dirname(os.path.abspath(__file__))# Add the file name you want to uploadfile_path=os.path.join(app_root,'test.txt')strip_path=file_path.rstrip(os.sep)fp_path=os.path.basename(strip_path)# Upload commandftp_obj.upload_file(fp_path)print(ftp_obj.get_message())

Similarly, you can download the files from the server in the same fashion:

# Add the filename to downloadftp_obj.download_file("hello.csv")print(ftp_obj.get_message())

Connects the remote host to the server from the information provided to the connect method.
If the connection is successful, the messaged will logged and displayed in the console, otherwise
Exception is raised with the error displayed to the console and program execution halts.

Checks if the directory you are trying to upload the files is already present or not and if
its already present CD’s into the directory and if not, creates the directory and CD’s into the
newly created directory.