Settings

Theme

Ask HN: Does This Python REPL Exist?

4 points by vnpc1 6 years ago · 1 comment · 2 min read


Inspired by the recent discussion on notebooks - https://news.ycombinator.com/item?id=22164916

I would like a Python setup a la RStudio. This means that:

- it works with unmodified plain text files - I don't want to use notebooks and I don't want cell magic (#%%) in my scripts

- at any point I can run a keyboard shortcut which executes the current line* of code

- if the cursor is on a part of a code block like the top line of a function definition or an if statement, the REPL is smart enough to figure out that I want to run the entire block of code

- after running, the cursor moves to the next line or to the line after the block that was just executed

- selecting multiple lines will obviously run all of them

- I don't need to insert an empty line at the end each block of code that I want to run (this is a problem with VSCode's "Send to terminal" option)

- selecting multiple lines allows you to run all of them of course

- the Python session stays live and can be inspected after the code finishes running

Open to suggestions about any editor/IDE/config file that can do this.

a-saleh 6 years ago

It was possible to setup Light Table to work like this. The project is unfortunately dead.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection