I am expecting these lists to be huge and was hoping to avoid re-parsing in python. Any way for the c program to return a list that python can directly use. <br>Thanks for the pointer to json :) I am going to explore and evaluate re-parsing overhead.<br>
thanks,<br>Ravi.<br><br><div class="gmail_quote">On Thu, Dec 11, 2008 at 10:19 AM, bob gailer <span dir="ltr">&lt;<a href="mailto:bgailer@gmail.com">bgailer@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">Ravi Kondamuru wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
I am writing a script to read list output from a C executable. How should c program be written so that python can read the output as a list?<br>
Any pointers to info on this appreciated.<br>
</blockquote>
<br></div></div>
Funny that a C programmer is asking for pointers, when C has lots of pointers and Python has none. &lt;chuckle&gt;<br>
<br>
Python I/O reads strings. So you must encode the list in some manner into a string and decode it into a list in the Python program.<br>
<br>
Take a look as json. <a href="http://www.json.org/" target="_blank">http://www.json.org/</a><br>
<br>
There are links to C and Python. You should be able there to findThats how to encode in C and decode in Python.<br>
<br>
You could &quot;roll your own&quot; encoding&quot; but I think json would be easier.<br>
<br>
Remember to reply-all so a copy goes to the list.<br><font color="#888888">
<br>
-- <br>
Bob Gailer<br>
Chapel Hill NC 919-636-4239<br>
<br>
</font></blockquote></div><br>