Re: [Chennaipy] binary data conversion

2020-09-11 Thread Vijay Kumar B.
On 11/09/20 10:41 pm, Mohamed ali Abdul wrote: Hi, Thanks Mr. Vijay. I want to convert every 2 bytes of data The below mentioned code is converting 4 bytes. That should be obvious from the array module documentation. Use array('h') instead of array('i'). Regards, Vijay __

[Chennaipy] binary data conversion

2020-09-11 Thread Mohamed ali Abdul
Hi, Thanks Mr. Vijay. I want to convert every 2 bytes of data The below mentioned code is converting 4 bytes. Please help me. Mohamed ali Code : import obspy from array import array tr= [] #fh = open('header10.txt','wb') st = obspy.read("/Users/kkngrmohd/Desktop/Stack7.segy", unpack_trace_hea