Interactive

Helper module for setting up interactive Diofant sessions.

diofant.interactive.printing.init_printing(no_global=False, pretty_print=None, **settings)[source]

Initializes pretty-printer depending on the environment.

Parameters:

no_global : boolean

If True, the settings become system wide; if False, use just for this console/session.

pretty_print : boolean or None

Enable pretty printer (turned on by default for IPython, but disabled for plain Python console).

**settings : dict

A dictionary of default settings for printers.

Examples

>>> from diofant.interactive import init_printing
>>> from diofant import Symbol, sqrt
>>> from diofant.abc import x, y, theta
>>> sqrt(5)
sqrt(5)
>>> init_printing(pretty_print=True, no_global=True)
>>> sqrt(5)
  ___
╲╱ 5
>>> theta
θ
>>> init_printing(pretty_print=True, use_unicode=False, no_global=True)
>>> theta
theta
>>> init_printing(pretty_print=True, order='grevlex', no_global=True)
>>> y + x + y**2 + x**2
 2    2
x  + y  + x + y
class diofant.interactive.session.AutomaticSymbols[source]

Add missing Symbol definitions automatically.

class diofant.interactive.session.IntegerWrapper[source]

Wraps all integers in a call to Integer()