I am currently working on a IDE /text editor coded in python and would like to add the option to run the code written by the user in a similar way to how it is displayed with IDLE. I have been trying out subprocess and os as well as the exec()
function but cannot find a way to print the output or error when the code doesn't work.
If anyone knows a way to do this it would be immensely helpful.