How to create file directory and load dataset in Python?

If I wanted to load a NIFTI file to analyze for my own project, how do I do so on the server? I understand the load function loads an image, but how can I loop through each subject and create a set of files that I can quickly refer to in analyzing my files? I am having trouble completing this task.