473,396 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Read and write binary data

Hi guys,
I am new to Python, and thinking about migrating to it from matlab
as it is a really cool language. Right now, I am trying to figure out
how to control read and write binary data, like
'formatted','stream','big-endian','little-edian' etc.. as in fortran.
I googled, but can not find a clear answer. Anyone has clue where can
I learn it? Thanks!!
Jinbo
Sep 7 '08 #1
5 2606
On Sep 7, 5:41*pm, Mars creature <jin...@gmail.comwrote:
Hi guys,
* I am new to Python, and thinking about migrating to it from matlab
as it is a really cool language. Right now, I am trying to figure out
how to control read and write binary data, like
'formatted','stream','big-endian','little-edian' etc.. as in fortran.
I googled, but can not find a clear answer. Anyone has clue where can
I learn it? Thanks!!
Jinbo
Start by looking at the array module.

Regards,
Pat
Sep 8 '08 #2
On Sep 7, 8:55 pm, Patrick Maupin <pmau...@gmail.comwrote:
On Sep 7, 5:41 pm, Mars creature <jin...@gmail.comwrote:
Hi guys,
I am new to Python, and thinking about migrating to it from matlab
as it is a really cool language. Right now, I am trying to figure out
how to control read and write binary data, like
'formatted','stream','big-endian','little-edian' etc.. as in fortran.
I googled, but can not find a clear answer. Anyone has clue where can
I learn it? Thanks!!
Jinbo

Start by looking at the array module.

Regards,
Pat
Thanks!!
Sep 8 '08 #3
On Sun, Sep 7, 2008 at 5:41 PM, Mars creature <ji****@gmail.comwrote:
Hi guys,
I am new to Python, and thinking about migrating to it from matlab
as it is a really cool language. Right now, I am trying to figure out
If you're trying to migrate from matlab to python I'd take a look at numpy:

http://numpy.scipy.org/

And scipy which is built on top of numpy:

http://www.scipy.org/

There is a plotting/numerical computation package known as matplotlib
that does its best to parallel matlab commands:

http://matplotlib.sourceforge.net/

There is support for reading and writing binary data, even fortran records.

And last but not least, you can always take a look at the scipy and
numpy mailing lists.

Good luck,

Kurt
how to control read and write binary data, like
'formatted','stream','big-endian','little-edian' etc.. as in fortran.
I googled, but can not find a clear answer. Anyone has clue where can
I learn it? Thanks!!
Jinbo
--
http://mail.python.org/mailman/listinfo/python-list
Sep 8 '08 #4
I don't know if this is going to help you
but a free&open alternative to Matlap is FreeMat just search for it
Sep 8 '08 #5
On Sep 7, 6:41 pm, Mars creature <jin...@gmail.comwrote:
Hi guys,
I am new to Python, and thinking about migrating to it from matlab
as it is a really cool language. Right now, I am trying to figure out
how to control read and write binary data, like
'formatted','stream','big-endian','little-edian' etc.. as in fortran.
I googled, but can not find a clear answer. Anyone has clue where can
I learn it? Thanks!!
Jinbo
the struct module should be useful
Sep 10 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Albert Tu | last post by:
Dear there, We have an x-ray CT system. The acquisition computer acquires x-ray projections and outputs multiple data files in binary format (2-byte unsigned integer) such as projection0.raw,...
19
by: Holger Hasselbach | last post by:
- The value of the object allocated by the malloc function is used (7.20.3.3). - The value of any bytes in a new object allocated by the realloc function beyond the size of the old object are used...
7
by: Mike Stephens | last post by:
I have a requirement to read / write to a proprietary data file. The fill will have no more than 10 records with no more than 10 fields. This is only for very simple data access. I want to...
9
by: sweety | last post by:
Dear All, How to encrypt a C data file and make binary file and then have to read a bin file at run time and decrypt the file and have to read the data. Any help to achive this pls. Would be...
3
by: nicolasg | last post by:
Hi, I'm trying to open a file (any file) in binary mode and save it inside a new text file. After that I want to read the source from the text file and save it back to the disk with its...
6
by: ericunfuk | last post by:
Hi ALL, I want to read a binary file(it's pic.tif file, I guess it's binary file?), then write it to a new file), I have several questions about this process: When I use fread() to read a...
9
by: vineeth | last post by:
Hello all, I have come across a weird problem, I need to determine the amount of bytes read from a file, but couldn't figure it out , My program does this : __ file = open("somefile") data =...
4
by: zl2k | last post by:
hi, there I have a appendable binary file of complex data structure named data.bin created by myself. It is written in the following format: number of Data, Data array Suppose I have...
5
by: dm3281 | last post by:
Hello, I have a text report from a mainframe that I need to parse. The report has about a 2580 byte header that contains binary information (garbage for the most part); although there are a...
1
by: Sachin Garg | last post by:
I have a program which opens a fstream in binary input+output mode, creating the file if it doesn't exists. But writing doesn't works after reading, it must be something obvious that I am not aware...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.