
November 23rd, 2004, 09:32 AM
|
|
Contributing User
|
|
Join Date: Oct 2004
Posts: 113

Time spent in forums: 3 Days 4 h 5 m 47 sec
Reputation Power: 5
|
|
Quote: | Originally Posted by Swede Hi,
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.
Best regards! |
# reading a file
f = open("filename-to-be-read-here", "r")
var = f.read()
f.close()
# writing the content to another file
f = open("filename-to-write-here", "w")
f.write(var)
f.close()
Unless your question is how to also format the content from a binary into a text file.. which depends on the binary
|