I have a task to encrypt a string using java class and replace the encrypted string into same file. I am trying to use subprocess but I have no luck, Kindly let me know what mistake I am making.
from subprocess import check_output,STDOUT, CalledProcessError
def search(filename,decryptstring):
# some python code ...
args= [ "C:/x/x/x/x/jre1.8.0_77/bin/java -cp" +" " '"lib\*"' +" " "x.x.x.x.x.util.CryptUtil" + " " "-decrypt" " "+ dstring]
h = subprocess.run(args, shell=True, stdout=subprocess.PIPE, universal_newlines= True, bufsize=-1 )
Output:
CompletedProcess(args=['C:/x/x/x/x/jre1.8.0_77/bin/java -cp'], returncode=1, stdout='')