Interpreter-style output in Python 3 (maybe about sys.displayhook?)
问题 I'm making a little toy command window with Tk, and currently trying to make it copy some interpreter behavior. I'd never scrutinized the interpreter before, but it's decisions on when to print a value are a little mystifying. >>> 3 + 4 # implied print(...) 7 >>> 3 # implied print(...) 3 >>> a = 3 # no output, no implied print(...), bc result is None maybe? >>> None # no output, no print(...) implied... doesn't like None? >>> print(None) # but it doesn't just ban all Nones, allows explicit