Jack Bates
Jack Bates

Reputation: 49

diff output of two python programs in windows cmd

So I am trying to compare output of two python programs, which have files that I will call trace1.py and trace2.py. Currently I am using process substitution with diff to try and compare their outputs, however I'm having trouble with finding both files, since they are in separate sub-directories of my current directory:

diff <(python /subdir1/tracing1.py) <(python /subdir2/tracing2.py)

When I run this, I get

The system cannot find the file specified.

I think I'm messing up some sort of path formatting, or else I'm using the process substitution incorrectly.

EDIT: In the end I decided that I didn't need to use process substitution, and instead could just diff program output after each program is run. However thanks to Fallenreaper in the comments, I was able to find a single command that does what I initially wanted:

python subdir1/tracing1.py > outfile1.txt & python subdir2/tracing2.py > outfile2.txt & diff outfile1.txt outfile2.txt

Upvotes: 0

Views: 337

Answers (1)

Madoo
Madoo

Reputation: 115

Sorry, not enough rep to comment yet :( Your line works perfectly when you remove that slash. I would suggest using absolute path names or a relative path from current directory cos that front slash would take you to your root directory.

Cheers.

Upvotes: 1

Related Questions