I have this code that pulls files from a server using Paramiko. How can I get these files sorted by modification date?
ssh = paramiko.SSHClient()
# automatically add keys without requiring human intervention
ssh.set_missing_host_key_policy( paramiko.AutoAddPolicy() )
ssh.connect(sftpURL, username=sftpUser, password=sftpPass)
sftp = ssh.open_sftp()
filesInSFTP = sftp.listdir(sftpPullDirectory)
# Get only the XML and XLSX files
filesInSFTP = [file for file in filesInSFTP if file.lower().endswith(('.xml', '.xlsx'))]