4
當我鍵入「蟒蛇」,並在外殼返回,下面的行會出來:如何抑制python的啓動信息?
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
如何surpress這些行嗎?
當我鍵入「蟒蛇」,並在外殼返回,下面的行會出來:如何抑制python的啓動信息?
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
如何surpress這些行嗎?
一個簡單的方法是將Python調用爲python -i -c ""
。但是,這也會禁用任何啓動腳本。如果您有啓動腳本,則還可以使用python -i ~/.pythonrc.py
(或者該腳本被命名)。
'python -i $ PYTHONSTARTUP'將運行默認的啓動腳本而不顯示啓動信息。 – updogliu 2012-07-24 09:15:15