Entering edit mode
5.2 years ago
imda
▴
10
Dear all,
I am trying to use a program called phyphy. This program runs into python. I would like to create a script that can run in all my files. i. e., in the line e = Extractor("/path/to/FEL.json")
the program uses a file in .json format but I have thousands of .json files. So, I want to create a script that can run for all the files that I have stored in several folders.
This is how I run the program into python but this is just for one file.
import phyphy
### Define a FEL Extractor, for example
e = Extractor("/path/to/FEL.json")
e.extract_csv("fel.csv") ## save to fel.csv
### tab-delimited output, as fel.tsv
e.extract_csv("fel.tsv", delim = "\t")
Please format your code using the code formatting button:
Additionally, it's not clear what you have tried or what in particular you're having trouble with. Looping through files or running a script on many files is fairly straightforward, and there are many, many tutorials on how to do so that can be found with minimal searching.