Did I find the right examples for you? yes no

All Samples(20)  |  Call(2)  |  Derive(7)  |  Import(11)
Generic printer

Its job is to provide infrastructure for implementing new printers easily.

Basically, if you want to implement a printer, all you have to do is:

1. Subclass Printer.

2. Define Printer.printmethod in your subclass.
   If a object has a method with that name, this method will be used(more...)

src/s/y/sympy-HEAD/sympy/printing/pretty/pretty.py   sympy(Download)
from sympy.core.compatibility import u, xrange
 
from sympy.printing.printer import Printer
from sympy.printing.str import sstr
from sympy.printing.conventions import requires_partial
class PrettyPrinter(Printer):
    """Printer, which converts an expression into 2D ASCII-art figure."""
    printmethod = "_pretty"
 
    _default_settings = {

src/s/y/sympy-0.7.5/sympy/printing/pretty/pretty.py   sympy(Download)
from sympy.core.compatibility import u, xrange
 
from sympy.printing.printer import Printer
from sympy.printing.str import sstr
from sympy.printing.conventions import requires_partial
class PrettyPrinter(Printer):
    """Printer, which converts an expression into 2D ASCII-art figure."""
    printmethod = "_pretty"
 
    _default_settings = {

src/s/y/sympy-polys-HEAD/sympy/printing/pretty/pretty.py   sympy-polys(Download)
from sympy.core import S, C, Basic
from sympy.printing.printer import Printer
from sympy.printing.str import sstr
from stringpict import prettyForm, stringPict
from sympy import Interval
class PrettyPrinter(Printer):
    """Printer, which converts an expression into 2D ASCII-art figure."""
    printmethod = "_pretty"
 
    _default_settings = {

src/s/c/scipy-2011-tutorial-HEAD/source/python/mathematica.py   scipy-2011-tutorial(Download)
from sympy.printing.printer import Printer
from sympy.printing.precedence import precedence
 
class MathematicaPrinter(Printer):
    """Print SymPy's expressions using Mathematica syntax. """

src/s/y/sympy-HEAD/sympy/printing/theanocode.py   sympy(Download)
from sympy.external import import_module
 
from sympy.printing.printer import Printer
import sympy
from functools import partial
class TheanoPrinter(Printer):
    """ Code printer for Theano computations """
    printmethod = "_theano"
 
    cache = dict()

src/s/y/sympy-0.7.5/sympy/printing/theanocode.py   sympy(Download)
from sympy.external import import_module
 
from sympy.printing.printer import Printer
import sympy
from functools import partial
class TheanoPrinter(Printer):
    """ Code printer for Theano computations """
    printmethod = "_theano"
 
    def __init__(self, *args, **kwargs):

src/s/y/sympy-polys-HEAD/sympy/galgebra/latex_ex.py   sympy-polys(Download)
 
from sympy.core import S, C, Basic, Symbol
from sympy.printing.printer import Printer
from sympy.simplify import fraction
import re as regrep
class LatexPrinter(Printer):
    """
    A printer class which converts an expression into its LaTeX equivalent. This
    class extends the LatexPrinter class currently in sympy in the following ways:
 

src/s/y/sympy-HEAD/sympy/interactive/printing.py   sympy(Download)
    """
    import sys
    from sympy.printing.printer import Printer
 
    if pretty_print:

src/a/r/ARM-console-HEAD/scripts/emusym.py   ARM-console(Download)
import funargs
from funargs import void, ptr
from sympy.printing.printer import Printer
from sympy.printing.str import StrPrinter
#from pprint >> log, import pprint

src/s/y/sympy-HEAD/sympy/utilities/tests/test_pickling.py   sympy(Download)
from sympy.printing.pretty.pretty import PrettyPrinter
from sympy.printing.pretty.stringpict import prettyForm, stringPict
from sympy.printing.printer import Printer
from sympy.printing.python import PythonPrinter
 
 
def test_printing():
    for c in (LatexPrinter, LatexPrinter(), MathMLPrinter,
              PrettyPrinter, prettyForm, stringPict, stringPict("a"),
              Printer, Printer(), PythonPrinter, PythonPrinter()):

  1 | 2  Next