I have tried many tactics to reorganize the output received from my query, but I'm unable to format the output being received back. I'm currently trying to compare two files using the "diff" command, but It sends all of the differences back mushed together. I have tried to reformat it by making it "diff -w", but Popen seems to not recognize the two commands together. Basically I'm trying to compare two Linux files and be able to format the output coming back so the user can easily look at what changes are being made.
#!/usr/bin/env python3
import subprocess
if(input("If you're happy with the changes say yes:") == "yes"):
test = subprocess.Popen(['diff','-w','/file1','/file2'],stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
output = test.communicate()[0]
print(output)