demo-magic icon indicating copy to clipboard operation
demo-magic copied to clipboard

REPL demo

Open rmonat opened this issue 1 year ago • 4 comments

Hi, I would like to run a demo in a REPL, such as the interactive python shell. My issue is that pe will wait for the end of the current command to go to the next, so just using pe for the REPL will not work. Is there any way to do that?

rmonat avatar May 28 '24 13:05 rmonat

Just pushed a repl function. Hope it helps.

paxtonhare avatar May 28 '24 14:05 paxtonhare

Thank you very much for your quick answer @paxtonhare. I was thinking about something where:

pe 'python3'
repl
pe "print(1 + .2)"
exit

Would allow pe to work inside the REPL too, do you think that would be possible?

rmonat avatar May 28 '24 14:05 rmonat

I'm not sure I follow. Can you elaborate? maybe show what the use case is?

paxtonhare avatar May 28 '24 20:05 paxtonhare

Sorry for being unclear. I would like to be able to produce commands through demo-magic both in the terminal interface and the underlying repl interface of, for example, python.

I would like to produce an output similar to https://asciinema.org/a/99317 using commands such as:

pe python
repl
pe "1+1"
pe "a=3"
pe "a"
pe "b=a*3"
pe "b"
pe "a*b"
pe "exit()"
exit

rmonat avatar May 28 '24 20:05 rmonat