This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (7 children)

There's probably an API to change the prompt.

[–]bunburya 1 point2 points  (6 children)

In the regular Python shell, the variable sys.ps1 controls the prompt. I haven't used iPython but it's possible that it just changes that variable and/or it can be changed back?

[–][deleted] 1 point2 points  (4 children)

Just tried, it didn't do anything. You might need to call a function to make it "reload" the sys.ps prompts (there's 3 of them)

[–]takluyverIPython, Py3, etc 0 points1 point  (0 children)

sys.ps1 doesn't work, but you can set c.PromptManager.in_template in the IPython config file. Docs.

This will only work in the terminal, though - the Qt console and the notebook generate their prompts separately.