2013-05-03 120 views
0

我編輯ipython_qtconsole_config.py包括時間戳:IPython的qtconsole忽略PromptManager變化

import datetime 
c = get_config() 
c.PromptManager.in_template = '%s In [\\#]: ' % datetime.datetime.now().strftime("%H:%M:%S") 

當我在shell我看到我的變化作出鍵入config PromptManager,但是沒有時間戳顯示。我該如何解決這個問題?

回答

0

qtconsole提示不支持常規IPython提示所做的大部分操作(即an open issue)。可配置也不同。

默認值:

c.IPythonWidget.in_prompt = 'In [<span class="in-prompt-number">%i</span>]: ' 

你可以改變它:

c.IPythonWidget.in_prompt = '<b><i>My Prompt </i>[%i]: </b>' 

當問題得到解決,就應該表現得完全像您期望的。

+0

謝謝,這是有效的。不幸的是,IPython只顯示啓動的時間,並且不會更新每個新行的時間戳。這裏的解決方案似乎並不工作http://stackoverflow.com/questions/3879752/is-there-a-way-to-get-a-local-timestamp-in-my-ipython-prompt/3902879 – cph 2013-05-06 22:28:57