Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New IPython Console (Spyder 2.2+): add an option to customize In/Out prompts #1056

Closed
spyder-bot opened this issue Feb 17, 2015 · 10 comments
Closed

Comments

@spyder-bot
Copy link
Collaborator

From pierre.raybaut on 2012-05-26T09:08:10Z

With IPython, it is very easy to customize the input/output prompts.

Default input prompt:
u'In [%i]: '

Default output prompt:
u'Out[%i]: '

To add this option, this is very simple. Do the same way as the option implemnted to set font. But the property to be used is: 'in_prompt' or 'out_prompt' instead of 'font'.

So, in 'apply_settings' and 'register_client', add something like that:

shellwidget.set_in_prompt(in_prompt_text)
shellwidget.set_out_prompt(out_prompt_text)

and in 'IPythonClient', add methods like those:

def set_in_prompt(self, in_prompt_text):
    """Set IPython widget's input prompt text"""
    self.ipython_widget.in_prompt = in_prompt_text

def set_out_prompt(self, out_prompt_text):
    """Set IPython widget's input prompt text"""
    self.ipython_widget.out_prompt = out_prompt_text

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1056

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2012-05-27T04:42:48Z

Labels: Cat-IPythonConsole

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2012-05-27T04:58:54Z

Labels: -Type-Defect Type-Task

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2012-05-27T05:05:37Z

Note: I've just checked there is even no need to check if the In/Out prompt texts are valid or not (IPython won't complain).

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2012-05-27T05:13:58Z

If I may ask: why is this important to you? It seems fairly advanced, I mean, to add it as an option...

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2012-05-27T06:13:07Z

The only reason why I suggested this is because, when exploring the IPython widget API, I noticed that these two properties (in_prompt, out_prompt) were very easy to change dynamically. That's all!

Apart from that, I have absolutely no interest of changing these prompts. But from time time, a user comes and asks for this kind of feature. So let's keep it here until (undone) and wait until someone asks about it (it will come!) and then we'll integrate it. That's why I wrote all this: to remind of how to implement this feature when it is time.

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2012-05-27T13:17:44Z

Labels: -Priority-Medium Priority-Low

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2012-07-05T20:14:35Z

Blocking: spyderlib:1053

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2012-10-27T19:49:11Z

This issue was updated by revision 372f61e399c7 .

Status: Started

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-01-27T12:13:59Z

Status: Fixed

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2015-02-15T16:14:33Z

Labels: -Component-IPython

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant