I was not refering to the curses popup completion and call tips, but just using Pygments to highlight code as it is entered. Does Pygment depend on Curses? I don't think so. Example:<div><br></div><div><span class="Apple-style-span" style="font-family: 'Times New Roman'; font-size: medium; "><pre style="background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; ">
<span class="kn" style="color: rgb(0, 112, 32); font-weight: bold; ">from</span> <span class="nn" style="color: rgb(14, 132, 181); font-weight: bold; ">pygments</span> <span class="kn" style="color: rgb(0, 112, 32); font-weight: bold; ">import</span> <span class="n">highlight</span>
<span class="kn" style="color: rgb(0, 112, 32); font-weight: bold; ">from</span> <span class="nn" style="color: rgb(14, 132, 181); font-weight: bold; ">pygments.lexers</span> <span class="kn" style="color: rgb(0, 112, 32); font-weight: bold; ">import</span> <span class="n">PythonLexer</span>
<span class="kn" style="color: rgb(0, 112, 32); font-weight: bold; ">from</span> <span class="nn" style="color: rgb(14, 132, 181); font-weight: bold; ">pygments.formatters</span> <span class="kn" style="color: rgb(0, 112, 32); font-weight: bold; ">import</span> Terminal<span class="n">Formatter</span>
<span class="n">code</span> <span class="o" style="color: rgb(102, 102, 102); ">=</span> <span class="s" style="color: rgb(64, 112, 160); ">'print "Hello World"'</span>
<span class="k" style="color: rgb(0, 112, 32); font-weight: bold; ">print</span> <span class="n">highlight</span><span class="p">(</span><span class="n">code</span><span class="p">,</span> <span class="n">PythonLexer</span><span class="p">(),</span> Terminal<span class="n">Formatter</span><span class="p">())</span></pre>
<pre style="background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; ">
<span class="p">Voilá, you get highlighted code in the terminal, without the need for curses....</span></pre><pre style="background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; ">
<span class="p"><br></span></pre><pre style="background-color: transparent; border-top-width: 1px; border-top-style: none; border-top-color: rgb(204, 204, 204); border-bottom-width: 1px; border-bottom-style: none; border-bottom-color: rgb(204, 204, 204); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 13px; font-family: 'Bitstream Vera Sans Mono', monospace; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-style: none; border-left-style: none; border-width: initial; border-color: initial; overflow-x: auto; overflow-y: auto; ">
<span class="p"><br></span></pre></span><br><div class="gmail_quote">On Mon, Jan 18, 2010 at 3:29 PM, Robert Kern <span dir="ltr"><<a href="mailto:robert.kern@gmail.com">robert.kern@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 2010-01-18 04:14 AM, Flavio Coelho wrote:<br>
> a little aesthetic request:<br>
><br>
> I wonder how hard would it be to have on the fly syntax highlighting as<br>
</div>> we can find in the bpython <<a href="http://bpython-interpreter.org/home/" target="_blank">http://bpython-interpreter.org/home/</a>><br>
> interpreter. Bpython uses pygments.<br>
<br>
The difficulty isn't the syntax highlighting but the cross-platform terminal<br>
support. bpython uses curses and thus is not portable to Windows. curses cannot<br>
be used for the main frontend to IPython. Implementing the cross-platform<br>
terminal support for such things yourself would also be tricky to accomplish.<br>
<br>
However, if you are willing to put in the effort, a UN*X-specific, bpython-like<br>
frontend to IPython could be made along the same lines as the wx and Qt frontends.<br>
<br>
--<br>
Robert Kern<br>
<br>
"I have come to believe that the whole world is an enigma, a harmless enigma<br>
that is made terrible by our own mad attempt to interpret it as though it had<br>
an underlying truth."<br>
-- Umberto Eco<br>
<br>
_______________________________________________<br>
IPython-user mailing list<br>
<a href="mailto:IPython-user@scipy.org">IPython-user@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-user" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-user</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Flávio Codeço Coelho<br><br>
</div>