November 23rd, 2004, 09:05 AM
Read binary file with stressdata
I'm a new user of Python and I will be using it for writing scripts to the FEM software ABAQUS.
My problem right now is that I have a binary file with data describing the stressdistribution in a component. I would like to write a python script that reads this file and writes it to a text-file. Is this possible?? And if, how do I start?
If necessery I can provide you with some C-code that reads from this binary file if this helps.
November 23rd, 2004, 09:32 AM
# reading a file
Originally Posted by Swede
f = open("filename-to-be-read-here", "r")
var = f.read()
# writing the content to another file
f = open("filename-to-write-here", "w")
Unless your question is how to also format the content from a binary into a text file.. which depends on the binary
November 23rd, 2004, 09:39 AM
Thanks alot! But as you mentioned on your last line I'm interested in format the content from binary into a text file. This part of a C-code that I have, could it be of any help to determine the binary?