ion package

I/O ninja (ION)… Utilities related to I/O that we find useful.

confirm(prompt)[source]

Prompt user for ‘y’ or ‘n’ answer.

Return type

bool

Returns

True iff the user responds to the @prompt with ‘y’.

Parameters

prompt (str) –

copy_to_clipboard(clip)[source]

Copys a clip to the system clipboard.

Parameters

clip (str) – The clip that gets copied into the clipboard.

Return type

None

efill(multiline_msg, width=80, indent=0)[source]

A better version of textwrap.fill().

Parameters
  • multiline_msg (str) –

  • width (int) –

  • indent (int) –

Return type

str

ewrap(multiline_msg, width=80, indent=0)[source]

A better version of textwrap.wrap().

Parameters
  • multiline_msg (str) –

  • width (int) –

  • indent (int) –

Return type

Iterator[str]

getch(prompt=None)[source]

Reads a single character from stdin.

Parameters

prompt (Optional[str]) – prompt that is presented to user.

Return type

str

Returns

The single character that was read.