Skip to content

Add an IPython mode to eval #2369

@ionite34

Description

@ionite34

Current working command schemes:

  • !eval -ipython
  • !e -i

Support IPython mode for eval with code blocks as "cells". Matplotlib will use a custom backend for show() which writes a png file to the output folder for upload.

This will use the ipykernel backend with full support for ipython magic commands like %%time

We can also inject custom exec tasks, imports, or custom ipython macros and magic commands via the ipython api.

Most of the runtime wrapper can be sent from the bot side, we will just require snekbox to add the ipython package to deployment.

Depends on

Proof of concept

image

  • Since IPython errors are colored with ANSI codes, we can use an ansi codeblock to render them

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: utilityRelated to utility commands: (bot, eval, extensions, jams, reminders, snekbox, utils)p: 2 - normalNormal Prioritys: planningDiscussing detailst: enhancementChanges or improvements to existing features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions