Console inside Panda

Hello All,

Does anyone know how to execute some user inputs as a python script?

I would like to add a interactive console to my game, where developper can type in scripts (at least line) and python would interpret them hereafter…

Search the docs at www.python.org for the eval() function and the exec command. In general, you can use eval(“expression”) to compute the value of any Python expression formatted as a string, and exec “command” to invoke any Python command formatted as a string. You can execute an entire Python program with the exec command if you want. There are also other options for specifying the scope at which these strings are evaluated.

David

Hello thanks a lot this work perfectly. It’s very helpfull when debugging for calling render.explore()
Now i ll fight a little to masterize GUI interface :slight_smile: