<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Thanks Fernando.<br>
      <br>
      Well, I would like to start the IPython terminal from a C code,
      and to use Python/C API to send the commands to processing in
      IPython, but when I start IPython the terminal don't receive the
      codes sent by PyRun_SimpleString. The code is here
      <a class="moz-txt-link-freetext" href="http://paste.kde.org/p8psqxtks">http://paste.kde.org/p8psqxtks</a>, easy to understand.<br>
      <br>
      I am thinking in to start a IPython kernel and make the
      communication using the client-server model. But, before this
      solution, is there any function to IPython process a command from
      the python interpreter? Anything like this, in python interpreter:<br>
      <br>
      import IPython<br>
      IPython.run(command_to_processing)<br>
      <br>
      ?<br>
      <br>
      Thanks;<br>
      <br>
      Em 23-02-2014 19:13, Fernando Perez escreveu:<br>
    </div>
    <blockquote
cite="mid:CAHAreOrmCCUTWTAgwUPN6+Ou55tC7Pk4ZD+9AbNfgKGKmrW5eQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">You may want to look at the various high-level
        entry points here:
        <div><br>
        </div>
        <div><a moz-do-not-send="true"
            href="http://docs.python.org/2/c-api/veryhigh.html">http://docs.python.org/2/c-api/veryhigh.html</a><br>
        </div>
        <div><br>
        </div>
        <div>It may be more convenient for you to put all the python
          code you'll need in a file and use one of the file-oriented C
          API functions.</div>
        <div><br>
        </div>
        <div>But overall, you're on the right track: IPython has no pure
          C API, only Python. So you'll need to use the functions to
          call Python source code from inside CPython.</div>
        <div><br>
        </div>
        <div>Cheers</div>
        <div><br>
        </div>
        <div>f</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Sun, Feb 23, 2014 at 1:58 PM, Filipe
          Saraiva <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:filipe@kde.org" target="_blank">filipe@kde.org</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
            <br>
            I would like to develop an IPython backend for Cantor, a IDE
            from<br>
            KDE-edu project for several mathematical softwares like
            Python 2,<br>
            Scilab, Maxima, Octave, etc. You can see the Python 2
            backend info in<br>
            <a moz-do-not-send="true"
              href="http://blog.filipesaraiva.info/?p=1213"
              target="_blank">http://blog.filipesaraiva.info/?p=1213</a>.<br>
            <br>
            I searched for info on the web about the use of Python/C API
            and IPython<br>
            but I can not find anything. I am thinking in to use
            PyRun_SimpleString<br>
            to send commands to IPython and get the commands output
            using<br>
            stdout/stderr to show this outputs in C side.<br>
            <br>
            I will appreciate any reference to use of Python/C API in
            IPython.<br>
            <br>
            Thank you;<br>
            <span class="HOEnZb"><font color="#888888"><br>
                --<br>
                Filipe Saraiva<br>
                <a moz-do-not-send="true"
                  href="http://filipesaraiva.info/" target="_blank">http://filipesaraiva.info/</a><br>
                <br>
                _______________________________________________<br>
                IPython-dev mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
                <a moz-do-not-send="true"
                  href="http://mail.scipy.org/mailman/listinfo/ipython-dev"
                  target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
              </font></span></blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        Fernando Perez (@fperez_org; <a moz-do-not-send="true"
          href="http://fperez.org" target="_blank">http://fperez.org</a>)<br>
        fperez.net-at-gmail: mailing lists only (I ignore this when
        swamped!)<br>
        fernando.perez-at-berkeley: contact me here for any direct mail<br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
IPython-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a>
<a class="moz-txt-link-freetext" href="http://mail.scipy.org/mailman/listinfo/ipython-dev">http://mail.scipy.org/mailman/listinfo/ipython-dev</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Filipe Saraiva
<a class="moz-txt-link-freetext" href="http://filipesaraiva.info/">http://filipesaraiva.info/</a></pre>
  </body>
</html>