Consider this -
$ echo print 4*2 | python -i Python 2.7.2 (default, Jun 20 2012, 16:23:33) Type "help", "copyright", "credits" or "license" for more information. >>> 8 >>> $
Echo produces print 4*2 . Python even interactively sees this as input that needs to be interpreted. Therefore, we see there 8. After that, the interpreter encounters the EOF , so it exits. Consider what you press to exit the interpreter - Ctrl+d or ^D This is another way to create EOF on * nix.
source share