How to create a json from subproccess in python -


i'm not sure if i'm titling question correctly, have following situation:

i subprocessing scala script ingests json file, , output string in json format. right have following code:

with open("stdout.txt", "w") out: p = subprocess.popen(['sbt', '--error', 'run /jsonfolder/example.json'], cwd = basedir, stdout = out) print out

which writes stdout.txt file in directory containing outputted string in json format. however, i'd "transform" .txt file .json "pretty" , "structured."

i've tried with open("stdout.json", "w") out: instead, did not work.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -