0

Hey guys is there a funtion in python that enables to output values to a bin files? Just like storing strings in .txt files, can we store hexadecimal values directly into .bin files? I am working using Python 2.7.3

2
Contributors
4
Replies
33
Views
4 Years
Discussion Span
Last Post by m_ishwar
2

look at this for an example. Basically, the key is in the open():

Modes 'r+', 'w+' and 'a+' open the file for updating (note that 'w+' truncates the file). Append 'b' to the mode to open the file in binary mode, on systems that differentiate between binary and text files; on systems that don’t have this distinction, adding the 'b' has no effect.

0

Thanks for the code @rrashkin. Is it possible to make a .bin file in place of a .dat file?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.