Skip to content

Python ​

Romain CasatiMay 1, 2026· in Python, Console, Notebook· 2 min read

Isolated kernels ​

Basthon's kernels (Python, OCaml, JavaScript, SQL and XCAS) are now isolated: the code runs in an environment separate from the web page that shows it. In practice:

  • more security: the code run has no access to the data of the page (such as your login information on a site that embeds Basthon);
  • a page that no longer freezes: a long computation no longer locks the interface;
  • real-time display: print and input show up as the run goes.

Play with it!

Real-time display

To get the former behaviour back, add the -legacy suffix to the kernel URL parameter, for instance https://console.basthon.fr/?kernel=python3-legacy. All the details are in the documentation.


Romain CasatiOctober 12, 2025· in Python· 1 min read

Python 3.12 ​

With the update of Pyodide to version 0.26, Basthon's Python kernel moves to Python 3.12. Among the novelties: more flexible f-strings (the same quotes can be reused inside) and even more telling error messages, which for instance suggest a forgotten import.

Play with it!

Python 3.12


Romain CasatiNovember 22, 2024· in Python· 1 min read

PythonTutor in colour ​

The step-by-step visualization of PythonTutor, available in Basthon through from tutor import tutor, gets two improvements:

  • syntax highlighting of the code;
  • a frame that fits automatically the size of the visualization, without a scroll bar.

Play with it!

PythonTutor


Romain CasatiNovember 17, 2024· in New modules, Python· 1 min read

icecream ​

Tired of print to debug? The icecream module is available in Basthon's Python kernel: ic(expression) shows both the expression and its value.

For it to work, Basthon now keeps the source code of the cells run: inspect.getsource also works on the functions defined in the notebook or the console.

Play with it!

icecream


Romain CasatiOctober 22, 2024· in Python, Notebook· 1 min read

clear_output ​

The clear_output function of the IPython.display module works in Basthon: it clears the output of the current cell. With wait=True, the clearing only happens at the next display, which avoids flickering. Perfect for a progress bar, a countdown or a little text animation!

Play with it!

clear_output