Basically, I'm trying to navigate through directories and call a specific program (called galfit
). The reason I navigate through the directories is because all of the files that I want to run through galfit
are in that directory. However, there are dozens of files, and individually running each file through galfit
would take far too long. On top of that, they take a while to process, so the overall process is incredibly slow.
Here's what the Ubuntu terminal code looks like:
vidur@vidur-VirtualBox:~$ cd Documents
vidur@vidur-VirtualBox:~/Documents$ cd XDF_Thumbnails_sci
vidur@vidur-VirtualBox:~/Documents$ ls
documents-export-2013-07-08 XDF_Images_Sci XDF_Images_Wht XDF_Thumbnails_Sci
vidur@vidur-VirtualBox:~/Documents$ cd XDF_Thumbnails_Sci
vidur@vidur-VirtualBox:~/Documents/XDF_Thumbnails_Sci$ ~/galfit galfit.feedme
galfit.feedme
is the feedme file that I wish to process; however, there are about fifty files in total (with different names, of course!) that I wish to process.
So my question is, how do you approach that through Python? Eventually I'll be looping through all the files (and likely somehow auto-naming them, that's easy), but what's the process to get to the directory and then run galfit
?