Running the following codes
with open('abc', 'wt') as fh:
fh.write('\n'.join(['a','b','c']))
in ipython, no outputs as expected;
however, in jupyter notebook, output like [Out 4]: 5.
It's possibly related to
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
in jupyter. But what's the strange thing jupyter output and how to prevent?