How to start Python REPL quietly?

ipython, python, startup, stdout

Solution

This seems to do the trick:

C:\Users\Bartek>python -i -c ""
>>> print "I ♥ Python!"
I ♥ Python!
>>> exit()

C:\Users\Bartek>

The `-i` option is described as:

-i : inspect interactively after running script; forces a prompt even if stdin does not appear to be a terminal; also PYTHONINSPECT=x

So as long as you're on a terminal, it doesn't seem to have any caveats.

`ipython` has a straightforward `--no-banner` option:

C:\Users\Bartek>ipython --no-banner

In [1]: print "I <3 Python!"
I <3 Python!

In [2]: exit()

C:\Users\Bartek>

It doesn't seem to support Unicode though ;)

Problem

Is there a way to startup python quietly, perhaps by setting some environment variable or supplying command line option? Instead of seeing this: ``` wim@SDFA100461C:/tmp$ python Python 2.7.5+ (default, Sep 19 2013, 13:48:49) [GCC 4.8.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> ``` Sometimes I want this behaviour, straight to the prompt: ``` wim@SDFA100461C:/tmp$ python >>> ``` I would also be interested in an answer for `ipython`.

Original source