comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » raw contents of data memory
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: raw contents of data memory [message #90272 is a reply to message #90271] Tue, 17 February 2015 13:07 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
I agree with Chris, string will do.
But just a remark. The result shown by python is different if you use the python print or implicit print (version 2.7.3 on a Raspberry Pi):

>>> a = np.array([112,121,116,104,111,110,32,105,115,32,40,115,111,1 09,101,116,105,109,101,115,41,32,97,108,115,111,32,102,117,1 10])
>>> a.tostring()
'p\x00\x00\x00y\x00\x00\x00t\x00\x00\x00h\x00\x00\x00o\x00\x 00\x00n\x00\x00\x00 \x00\x00\x00i\x00\x00\x00s\x00\x00\x00 \x00\x00\x00(\x00\x00\x00s\x00\x00\x00o\x00\x00\x00m\x00\x00 \x00e\x00\x00\x00t\x00\x00\x00i\x00\x00\x00m\x00\x00\x00e\x0 0\x00\x00s\x00\x00\x00)\x00\x00\x00 \x00\x00\x00a\x00\x00\x00l\x00\x00\x00s\x00\x00\x00o\x00\x00 \x00 \x00\x00\x00f\x00\x00\x00u\x00\x00\x00n\x00\x00\x00'
>>> print a.tostring()
python is (sometimes) also fun

notice also that:
>>> print 'p\x00\x00\x00y\x00\x00\x00t\x00\x00\x00h\x00\x00\x00o\x00\x 00\x00n\x00\x00\x00 \x00\x00\x00i\x00\x00\x00s\x00\x00\x00 \x00\x00\x00(\x00\x00\x00s\x00\x00\x00o\x00\x00\x00m\x00\x00 \x00e\x00\x00\x00t\x00\x00\x00i\x00\x00\x00m\x00\x00\x00e\x0 0\x00\x00s\x00\x00\x00)\x00\x00\x00 \x00\x00\x00a\x00\x00\x00l\x00\x00\x00s\x00\x00\x00o\x00\x00 \x00 \x00\x00\x00f\x00\x00\x00u\x00\x00\x00n\x00\x00\x00'
python is (sometimes) also fun

>>> print r'A\x00\x00\x00B\x00\x00\x00'
A\x00\x00\x00B\x00\x00\x00
>>> print r'p\x00\x00\x00y\x00\x00\x00t\x00\x00\x00h\x00\x00\x00o\x00\ x00\x00n\x00\x00\x00 \x00\x00\x00i\x00\x00\x00s\x00\x00\x00 \x00\x00\x00(\x00\x00\x00s\x00\x00\x00o\x00\x00\x00m\x00\x00 \x00e\x00\x00\x00t\x00\x00\x00i\x00\x00\x00m\x00\x00\x00e\x0 0\x00\x00s\x00\x00\x00)\x00\x00\x00 \x00\x00\x00a\x00\x00\x00l\x00\x00\x00s\x00\x00\x00o\x00\x00 \x00 \x00\x00\x00f\x00\x00\x00u\x00\x00\x00n\x00\x00\x00'
p\x00\x00\x00y\x00\x00\x00t\x00\x00\x00h\x00\x00\x00o\x00\x0 0\x00n\x00\x00\x00 \x00\x00\x00i\x00\x00\x00s\x00\x00\x00 \x00\x00\x00(\x00\x00\x00s\x00\x00\x00o\x00\x00\x00m\x00\x00 \x00e\x00\x00\x00t\x00\x00\x00i\x00\x00\x00m\x00\x00\x00e\x0 0\x00\x00s\x00\x00\x00)\x00\x00\x00 \x00\x00\x00a\x00\x00\x00l\x00\x00\x00s\x00\x00\x00o\x00\x00 \x00 \x00\x00\x00f\x00\x00\x00u\x00\x00\x00n\x00\x00\x00

The implicit print option is a bit more complicated to reproduce in IDL (at least I guess that it involves quite a bit of formatting).

Regards,
Helder

ps: I think I put into those lines just about all of my python knowledge. Not much.
ps2: not sure if IDL or Python are fun... But for sure the latter can be a real pain...
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Downgrade in support for non US users?
Next Topic: IDL8.4 hard crash

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:39:03 PDT 2025

Total time taken to generate the page: 0.00450 seconds