From 5eb03bf060674f785ffda490de99d147fa81e523 Mon Sep 17 00:00:00 2001 From: "Bradley M. Froehle" Date: Wed, 9 May 2012 17:34:11 -0700 Subject: [PATCH] Define generic sys.ps{1,2,3}, for use by scripts. Closes #123 --- IPython/core/interactiveshell.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index d924fa95424..ce69fa11c72 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -637,6 +637,11 @@ def init_io(self): def init_prompts(self): self.prompt_manager = PromptManager(shell=self, config=self.config) self.configurables.append(self.prompt_manager) + # Set system prompts, so that scripts can decide if they are running + # interactively. + sys.ps1 = 'In : ' + sys.ps2 = '...: ' + sys.ps3 = 'Out: ' def init_display_formatter(self): self.display_formatter = DisplayFormatter(config=self.config)