本文整理汇总了Python中sympy.printing.str.sstr函数的典型用法代码示例。如果您正苦于以下问题:Python sstr函数的具体用法?Python sstr怎么用?Python sstr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sstr函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __str__
def __str__(self): # pragma: no cover
from sympy.printing.str import sstr
if self.dom is None:
return "%s does not divide %s" % (sstr(self.g), sstr(self.f))
else:
return "%s does not divide %s in %s" % (sstr(self.g), sstr(self.f), sstr(self.dom))
开发者ID:A-turing-machine,项目名称:sympy,代码行数:7,代码来源:polyerrors.py
示例2: _print_Float
def _print_Float(self, e):
# we will use StrPrinter's Float printer, but we need to handle the
# full_prec ourselves, according to the self._print_level
full_prec = self._settings["full_prec"]
if full_prec == "auto":
full_prec = self._print_level == 1
return prettyForm(sstr(e, full_prec=full_prec))
开发者ID:TeddyBoomer,项目名称:wxgeometrie,代码行数:7,代码来源:pretty.py
示例3: __call__
def __call__(self, a):
"""Construct an element of `self` domain from `a`. """
res = self.dtype(a, self.dom, len(self.gens) - 1, ring=self)
# make sure res is actually in our ring
if res.denom().terms(order=self.order)[0][0] != (0,)*len(self.gens):
from sympy.printing.str import sstr
raise CoercionFailed("denominator %s not allowed in %s"
% (sstr(res), self))
return res
开发者ID:malikdiarra,项目名称:sympy,代码行数:10,代码来源:polynomialring.py
示例4: _sympystr
def _sympystr(self, printer, *args):
from sympy.printing.str import sstr
length = len(self.args)
s = ''
for i in range(length):
if isinstance(self.args[i], (Add, Pow, Mul)):
s = s + '('
s = s + sstr(self.args[i])
if isinstance(self.args[i], (Add, Pow, Mul)):
s = s + ')'
if i != length-1:
s = s + 'x'
return s
开发者ID:101man,项目名称:sympy,代码行数:13,代码来源:tensorproduct.py
示例5: __str__
def __str__(f):
from sympy.printing.str import sstr
return sstr(f.rep)
开发者ID:KonstantinTogoi,项目名称:sympy,代码行数:3,代码来源:extensions.py
示例6: __str__
def __str__(self):
from sympy.printing.str import sstr
return sstr(self, order=None)
开发者ID:Acebulf,项目名称:sympy,代码行数:3,代码来源:defaults.py
注:本文中的sympy.printing.str.sstr函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论