So, I'm trying to make a calculator in Python 3.5 and here's the outline of what I'm trying to do:
def getOut(code):
result=exec(code, use="PyShell").stdout() #Use python shell to do command [code].
return result #Return [result].
code=input("Problem: ") #Get problem/command.
print(f'The answer is: {getOut(code)}.') #Print result of command.
Is there any way to get the stdout
of it? I wanna use (emulated) Python shell, but don't want to use the viewable Python shell.