Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Starting Python from the terminal with no welcome message

10 views
Skip to first unread message

candide

unread,
Feb 28, 2010, 6:23:38 PM2/28/10
to
Hi,

Does exist some option I could send to the python interpreter during an
interactive session in order to avoid the printing of the introductory
message just above the top prompt ?

In my case, the welcome message is the following :

Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

gdb has such an option (the so-called quiet option).


Compare this :

$ gdb
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
(gdb)

with that

$ gdb -q
(gdb)


Tim Chase

unread,
Feb 28, 2010, 8:21:29 PM2/28/10
to pytho...@python.org
candide wrote:
> Does exist some option I could send to the python interpreter during an
> interactive session in order to avoid the printing of the introductory
> message just above the top prompt ?
>
> In my case, the welcome message is the following :
>
> Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
> [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.

I asked a similar question a while back:

http://www.opensubscriber.com/message/pytho...@python.org/4611139.html

(strangely, I couldn't find that in the mail.python.org archives
via google)

If you don't want to monkey with the prompts (like I did in that
thread), you can just use

bash$ python -ic ""

to get a python shell without the banner.

That said, it _would_ be a nice addition to have a "-q"uiet
startup option that behaves like many other apps do. But with it
being just a few extra characters on the command-line, I don't
expect it will happen.

-tkc


candide

unread,
Mar 1, 2010, 5:58:57 AM3/1/10
to
Tim Chase a �crit :

>
> bash$ python -ic ""
>
> to get a python shell without the banner.
>


Works fine. thanks a lot.

0 new messages