This is a development version (9.14.0.dev) and may be unstable. Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.14.0.dev / IPython / utils / text / DollarFormatter

class

IPython.utils.text:DollarFormatter

source: /IPython/utils/text.py :523

Signature

class   DollarFormatter ( )

Members

Summary

Formatter allowing Itpl style $foo replacement, for names and attribute access only. Standard {foo} replacement also works, and allows full evaluation of its arguments.

Examples

:: In [1]: f = DollarFormatter() In [2]: f.format('{n//4}', n=8) Out[2]: '2' In [3]: f.format('23 * 76 is $result', result=23*76) Out[3]: '23 * 76 is 1748' In [4]: f.format('$a or {b}', a=1, b=2) Out[4]: '1 or 2'

Aliases

  • IPython.core.interactiveshell.DollarFormatter