Question

I edited ipython_qtconsole_config.py to include a timestamp:

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

When I type config PromptManager in the shell I see that my change was made, however no timestamp is displayed. How can I fix this issue?

Was it helpful?

Solution

The qtconsole prompt doesn't support most of what the regular IPython prompt does (which is an open issue). The configurable is also different.

The default value:

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

You can change it with:

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

When the issue is addressed, it should behave exactly as you expect.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top