alexander-bauer/swirlypy

Create issue type to capture shell expressions

Closed this issue · 1 comments

There are two types of questions frequently discussed that involve capturing shell output. Here, I am specifically referring to expressions, which don't assign their value to anything. For example, x**2, as opposed to y = x**2. I want to be able to treat expressions like that as submissions, without requiring the user to explicitly exit the shell.

Most of the code, as of this writing, exists, including the InteractiveConsole callbacks, and all of the fun stuff. However, at its core, InteractiveConsole uses exec, which is notoriously difficult to get output from. My best advance thus far has been to use AST to edit any line of code marked as an Expr, and append that to a special value. Documentation is sparse, though.

All fixed as of 4d5f02e.