Hello. I am new to Python. I've just installed version 3.0.1, which I will be using on a Linux box (which I am also new to), and need to use it to essentially call on several files of a specific type within a directory and run an external program to convert them to a different type.
So far I have figured out how to list files in a directory using os.listdir, but I was wondering, is there a way that I could list specific file types? For example: I am trying to specifically list only files with the .sac extension.
After I find all of these .sac files, I need to run a program to convert each file individually into .seed files. To do this I believe I will need to create a loop that cycles through each file name, running it through the external program, and ending once it has run through all of the files.
I am extremely lost, since I have very little programming experience. Any help would be highly appreciated. Thank you in advance.
So far I have figured out how to list files in a directory using os.listdir, but I was wondering, is there a way that I could list specific file types? For example: I am trying to specifically list only files with the .sac extension.
After I find all of these .sac files, I need to run a program to convert each file individually into .seed files. To do this I believe I will need to create a loop that cycles through each file name, running it through the external program, and ending once it has run through all of the files.
I am extremely lost, since I have very little programming experience. Any help would be highly appreciated. Thank you in advance.
Comment