I have gone through the below link for connecting to mainframe and extracting files from a PDS.
Downloading text files with Python and ftplib.FTP from z/os
But, a