Did I find the right examples for you? yes no

All Samples(21)  |  Call(15)  |  Derive(0)  |  Import(6)
Set whether pretty-printer should use unicode by default

        def pretty_use_unicode(flag=None):
    """Set whether pretty-printer should use unicode by default"""
    global _use_unicode
    global unicode_warnings
    if flag is None:
        return _use_unicode

    if flag and unicode_warnings:
        # print warnings (if any) on first unicode usage
        warnings.warn(unicode_warnings)
        unicode_warnings = ''

    use_unicode_prev = _use_unicode
    _use_unicode = flag
    return use_unicode_prev
        


src/s/y/sympy-0.7.5/sympy/printing/pretty/pretty.py   sympy(Download)
 
from .stringpict import prettyForm, stringPict
from .pretty_symbology import xstr, hobj, vobj, xobj, xsym, pretty_symbol, \
    pretty_atom, pretty_use_unicode, pretty_try_use_unicode, greek_unicode, U, \
    annotated
    def _use_unicode(self):
        if self._settings['use_unicode']:
            return True
        else:
            return pretty_use_unicode()
    # XXX: this is an ugly hack, but at least it works
    use_unicode = pp._settings['use_unicode']
    uflag = pretty_use_unicode(use_unicode)
 
    try:
        return pp.doprint(expr)
    finally:
        pretty_use_unicode(uflag)

src/s/y/sympy-HEAD/sympy/printing/pretty/pretty.py   sympy(Download)
 
from .stringpict import prettyForm, stringPict
from .pretty_symbology import xstr, hobj, vobj, xobj, xsym, pretty_symbol, \
    pretty_atom, pretty_use_unicode, pretty_try_use_unicode, greek_unicode, U, \
    annotated
    def _use_unicode(self):
        if self._settings['use_unicode']:
            return True
        else:
            return pretty_use_unicode()
    # XXX: this is an ugly hack, but at least it works
    use_unicode = pp._settings['use_unicode']
    uflag = pretty_use_unicode(use_unicode)
 
    try:
        return pp.doprint(expr)
    finally:
        pretty_use_unicode(uflag)

src/s/y/sympy-polys-HEAD/sympy/printing/pretty/pretty.py   sympy-polys(Download)
from sympy import Interval
 
from pretty_symbology import xstr, hobj, vobj, xobj, xsym, pretty_symbol,\
        pretty_atom, pretty_use_unicode, pretty_try_use_unicode, greek
 
    def _print_floor(self, e):
        if pretty_use_unicode():
            pform = self._print(e.args[0])
            pform = prettyForm(*pform.parens('lfloor', 'rfloor'))
            return pform
        else:
            return self._print_Function(e)
 
    def _print_ceiling(self, e):
        if pretty_use_unicode():
 
            # XXX hack!
            ascii_mode = not pretty_use_unicode()
            if ascii_mode:
                H += 2
    def _print_gamma(self, e):
        if pretty_use_unicode():
            pform = self._print(e.args[0])
            pform = prettyForm(*pform.parens())
            pform = prettyForm(*pform.left(greek['gamma'][1]))

src/s/y/sympy-0.7.5/sympy/printing/pretty/stringpict.py   sympy(Download)
from __future__ import print_function, division
 
from .pretty_symbology import hobj, vobj, xsym, xobj, pretty_use_unicode
from sympy.core.compatibility import u, string_types, xrange
 
 
        # XXX this is a hack -- ascii parens are ugly!
        if ifascii_nougly and not pretty_use_unicode():
            h = 1
            b = 0

src/s/y/sympy-HEAD/sympy/printing/pretty/stringpict.py   sympy(Download)
from __future__ import print_function, division
 
from .pretty_symbology import hobj, vobj, xsym, xobj, pretty_use_unicode
from sympy.core.compatibility import u, string_types, xrange
 
 
        # XXX this is a hack -- ascii parens are ugly!
        if ifascii_nougly and not pretty_use_unicode():
            h = 1
            b = 0

src/s/y/sympy-polys-HEAD/sympy/printing/pretty/stringpict.py   sympy-polys(Download)
"""
 
from pretty_symbology import hobj, vobj, xsym, pretty_use_unicode
 
class stringPict(object):
 
        # XXX this is a hack -- ascii parens are ugly!
        if ifascii_nougly and not pretty_use_unicode():
            h = 1
            b = 0