Adriaan Renting wrote:
> - print line, did remove the extra newlines, but didn't get rid of the
> blank lines.
You mean you found that
import fileinput
for line in fileinput.FileInput("test.xml", inplace=True):
if line.strip():
print line,
does not remove all blank lines?
If the f
Thanks for the various people that provided help.
Peter Otten provided me with a working solution:
I had to split the "-I '^[[:space:]]*$'" into two commands.
cmd = ["diff", "-w", "-I", r"^[[:space:]]*$", "./xml/%s.xml" %
name, "test.xml"]
p = subprocess.Popen(cmd, stdin=open(
Adriaan Renting wrote:
>
> Maybe someone here has a clue what is going wrong here? Any help is
> appreciated.
>
> I'm writing a regression test for a module that generates XML.
>
> I'm using diff to compare the results with a pregenerated one from an
> earlier version.
>
> I'm running into two
Hello Adriaan,
>Maybe someone here has a clue what is going wrong here? Any help is
>appreciated.
Have you tried out this tool that does precisely what you need? to
do yourself?
https://pypi.python.org/pypi/xmldiff
I can't vouch specifically for it, am simply a user, but I know that
I hav
On 01/14/2016 03:22 PM, Adriaan Renting wrote:
Maybe someone here has a clue what is going wrong here? Any help is
appreciated.
I'm writing a regression test for a module that generates XML.
I'm using diff to compare the results with a pregenerated one from an
earlier version.
I'm running in
On Thu, Jan 14, 2016 at 2:22 PM, Adriaan Renting wrote:
> Any suggestions?
Instead of trying to make diff behave through subprocess, have a look
at Python's difflib: https://docs.python.org/3/library/difflib.html
In particular, I think `difflib.ndiff(first_list_of_strings,
second_list_of_strings