Running this command in the terminal works fine:
java -jar file.jar --arg1 --arg2 pathTofile
When I then try to do this from the python code using following code:
subprocess.call(['java', '-jar', 'file.jar', '--arg1' , '--arg2' , 'pathTofile'])
I get an IllegalArugmentException for –arg1.
Any ideas on why this could generate a problem?
Ok I figuered it out.
When using the subprocess routine in python you need to quote the option and concurrent value seperatly
eg:
putting the -option and value in one quote generates this error.
I have read somewhere that you can only put the -option and value in one quote if you put shell=True at the end. (untested)