I'm trying to create a script that reruns maxent for different inputs. I have around 1500 species that need to be processed separately. My idea is to use a python loop for this program. But I can't seem to find the right information to start. Right now I have 3 simple lines which tells python to open the program.
import subprocess
subprocess.call(['java', '-jar', r'C:\Program Files (x86)\Maxent\maxent.jar'])
subprocess.call([r'C:\Program Files (x86)\Maxent\maxent.bat'])
Now I want to tell python which input to use. However, I can't seem to find any documentation on a function which specifies the input for a program.
Does anyone have any ideas on how to approach the next step?
-------------------Edit------------------------------------
Right now I have the following code:
import glob
import subprocess
insect = glob.glob('D:\Maxent\samples\*.csv')
for species in insect:
subprocess.call(['java', '-jar', r'D:\Maxent\maxent.jar', 'environmentallayers=D:\Maxent\layers',
species, 'outputdirectory= D:\Maxent\outputs', 'redoifexists', 'autorun'])
This gives me the following error in maxent:
Initialization flags not understood: D:\Maxent\samples\Aeshna_juncea.csv
and the folowing error in pyhton
C:\Users\merel\PycharmProjects\untitled\venv\Scripts\python.exe "C:/Users/merel/PycharmProjects/untitled/maxent python.py"
Error: Initialization flags not understood: species
Error: No species selected
I also tried it with the ' around species. This gave me the following error:
C:\Users\merel\PycharmProjects\untitled\venv\Scripts\python.exe "C:/Users/merel/PycharmProjects/untitled/maxent python.py"
Error: Initialization flags not understood: species
Error: No species selected
I don't know why the program doesn't understand the argument. I also tried it with x instead of species to make sure that the word species didn't already exist in the library.