<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>Le 25 janv. 2015 à 19:57, Thomas Kluyver a écrit :</div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra">First, let me emphasise that all of this is only relevant for executing Python code. If you're building a kernel for another language, you should ignore all of this. That documentation page is only about IPython's own kernel.<br><br></div><div class="gmail_extra">The three modes described on that page (exec, eval, single) are compilation modes of Python itself, passed as arguments to the built-in compile() function.<br><br></div><div class="gmail_extra">The parameter passed to our run_ast_nodes() method (which can be all, none, last or last_expr) controls which of a list of AST nodes are compiled in 'single' mode. Our default of last_expr is chosen specifically so that the for loop example above does not produce output, because we think that's more likely to be annoying than useful. There is no way to control this from the frontend, and I don't think we have any intention to add such a feature.<br><br></div><div class="gmail_extra">For your own kernel, you should implement whatever display of output makes sense given the language and the likely users. For Python, we decided that it makes sense to automatically display the result of the last statement if that statement is an expression, and implemented that using the details described above. For R, I implemented similar behaviour based on the evaluate package by creating an output_handler with a value= parameter.<br><br></div><div class="gmail_extra">Which language are you working on a kernel for?<br></div></div></blockquote><div><br></div>Shot in the dark, helped by google IPerl: </div><div><br></div><div><a href="https://github.com/zmughal/p5-Devel-IPerl">https://github.com/zmughal/p5-Devel-IPerl</a></div><div><br></div><div>-- </div><div>M</div><div><br></div></body></html>