"Window error:- Unable to find specified file" in Python

123 Views Asked by At

I am trying to call jar file from qgis Python plugin using

subprocess.call(['java', '-jar', 'abc.jar', 'Path'])

and want to close qgis after calling jar using

 sys.exit(0)

If I run this code from individual file it runs fine but when I run it from qgis plug-in in Windows and Centos system it is throwing error

In Windows system

 Window error:- Unable to find specified file 

In Centos system

Error:-   Unable to access file

I am unable to find out the actual problem.

1

There are 1 best solutions below

4
On

try using

subprocess.call(['java', '-jar', 'abc.jar', 'Path'],shell=True)