You can redirect print() to output to an editbox by running this script at the start of the layout:
def write(self, message):
sys.stdout = output()[/code:17j2ia61]
Input could be done similarly but it's more complicated since you need a way to get input. AKA no simple solution exists.