How to copy directory from remote server to local

I need to find a .dat file in a specific folder of remote Unix server and copy the file name to local machine

Please help me with code…I am new to python n struggling from 2 weeks

Do you know the path to the .dat file?

 remotefile = 'path/to/remote/file.dat'
 localfile = '/tmp/local.dat'

 import shutil

 shutil.copyfile(remotefile, localfile)