Try to use subprocess library. I hope it helps you: Subprocess management
Syntax error while executing java command in python script
-
31-05-2022 - |
Вопрос
i want to execute following command in a python script
java -cp lib/*:esalib.jar clldsystem.esa.ESAAnalyzer "$1" "$2"
but i'm getting a syntax error due to the '*' and ':' in the path of jar files. How else could i do it?
Решение
Другие советы
i used the subprocess library and its working now.:) Here is how i did it
import shlex,subprocess
x='java -cp "lib/*:esalib.jar" clldsystem.esa.ESAAnalyzer "$1" "$2"'
args=shlex.split(x)
p=subprocess.Popen(args)
Не связан с StackOverflow