Ask Your Question
0

Python file to compare output [closed]

asked 2022-08-29 11:02:42 -0600

alexius gravatar image

Hi, I have different output file that I have to check if they are equal. Is there a quick way maybe with Python?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by alexius
close date 2022-09-05 02:21:24.192494

Comments

Do you mean result files from dynamic simulations (.out) or any other kind of output from PSSE?

perolofl gravatar imageperolofl ( 2022-08-30 01:41:07 -0600 )edit

Yes exactly dynamic simultions .out

alexius gravatar imagealexius ( 2022-08-30 02:05:40 -0600 )edit

2 answers

Sort by » oldest newest most voted
1

answered 2022-08-30 03:35:11 -0600

perolofl gravatar image

One way may be to open both files with dyntools and compare the channel values.

edit flag offensive delete link more
1

answered 2022-08-30 09:33:13 -0600

jconto gravatar image

The OUT file is in binary format. To compare two OUT files in python, go to the internet and search for "python binary file compare". One of such links is "https://codereview.stackexchange.com/questions/171003/python-code-that-compares-two-files-byte-by-byte".

BTW, you can compare binary files on any other language and commercial programs are available.

To compare attributes of a OUT file, like difference in channels, use the dyntools module and python code around it. I have not seen yet a tool that do that.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-08-29 11:02:42 -0600

Seen: 551 times

Last updated: Aug 30 '22