IPython Documentation

Table Of Contents

Previous topic

Module: nbconvert.utils.base

Next topic

Module: nbconvert.utils.exceptions

This Page

Module: nbconvert.utils.console

Utility functions for interacting with the console

3 Functions

IPython.nbconvert.utils.console.input(prompt_text)

Prompt the user for input.

The input command will change depending on the version of python installed. To maintain support for 2 and earlier, we must use raw_input in that case. Else use input.

Parameters:

prompt_text : str

Prompt to display to the user.

IPython.nbconvert.utils.console.prompt_boolean(prompt, default=False)

Prompt the user for a boolean response.

Parameters:

prompt : str

prompt to display to the user

default : bool, optional

response to return if none is given by the user

IPython.nbconvert.utils.console.prompt_dictionary(choices, default_style=1, menu_comments={})

Prompt the user to chose one of many selections from a menu.

Parameters:

choices : dictionary

Keys - choice numbers (int) Values - choice value (str), this is what the function will return

default_style : int, optional

Choice to select if the user doesn’t respond

menu_comments : dictionary, optional

Additional comments to append to the menu as it is displayed in the console. Keys - choice numbers (int) Values - comment (str), what will be appended to the corresponding choice