unrepl: a new module to translate REPL code fragments to proper Python code

Aug. 12, 2022
11:05 p.m.
In many blogs, articles, books, etc. code if often presented as REPL code fragments, like
If you actually want to run that code, you have to remove the >>> (and ...) and add a print statement. With unrepl, you can do that just by copying the above code to the clipboard and run repl.py. The clipboard will then be changed to a = 1 b = 2 _ = a + b; print(_) # a + b # 3 And you can just run this code! Unrepl can be used as a command line tool but also a module. Instructions to create a hotkey to execute the translation of the clipboard under Windows are in the readme.md file. You can find unrepl (including an extensive readme) on GitHub: www.github.com/salabim/unrepl or you can install it from PyPI with pip install unrepl
951
Age (days ago)
951
Last active (days ago)
0 comments
1 participants
participants (1)
-
Ruud van der Ham