I'm not sure if I'm titling my question correctly, but I have the following situation:
I am subprocessing a Scala script which ingests a json file, and the output is a string in json format. Right now I have the following code:
with open("stdout.txt", "w") as out:
p = subprocess.Popen(['sbt', '--error', 'run /jsonfolder/Example.json'], cwd = BASEDIR, stdout = out)
print out
which writes the stdout.txt
file in my directory containing the outputted string in json format. However, I'd like to "transform" this .txt file into a .json where it is "pretty" and "structured."
I've tried with open("stdout.json", "w") as out:
instead, but it did not work.