I added an in game python shell as well as some bug fixes.
Only available for spigot.
do /pyshell (or any of its aliases) to toggle it.
/pyshell toggle | toggles the shell.
/pyshell stop, off, disable | disables the shell.
/pyshell begin, start, on, enable | enables the shell.
/pyshell reset | resets the shell (removes all variables, functions, etc and starts from scratch)
/pyshell getlines | gets all the lines you executed.
stdout and stderr are redirected to you, the player with white and red as default colours respectively.
You can also do
exit() to exit the shell.
Minecraft replaces multiple spaces with just one, so to have more than one space, you can do
\ . It gets replaced with a single space. You can chain these together to make multiple spaces (for indentation purposes).
If you have an incomplete thing, the shell will go into a sort of "scripting" mode where it appends all your stuff to a buffer until you send a single
\ (essentially an empty string). For example:
Code (Text):
> sq = lambda x: x * x
> if sq(3) == 9:
> \ \ print "the square of 3 is 9"
> \
"the square of 3 is 9"