|
From: | Marcus Müller |
Subject: | Re: [Discuss-gnuradio] Async Message to File |
Date: | Fri, 19 Feb 2016 00:12:18 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 |
Argh, sorry, to_float returns a float64, which of course means that
Python's file.write is a bit confused by this request, and it's
getting late :/ concentration used to be better. So, add import struct where the other imports are. Then, self._file.write(struct.pack("d", pmt.to_float(msg) ) ) should 1. get the 64 bit float from the pmt message, 2. pack that into a string object according to the format "d" (which simply says, take a single double and give it to me as raw 8 bytes) 3. writes that to the file. Best regards, Marcus On 19.02.2016 00:05, Richard Bell
wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |