当前位置: 首页>>代码示例>>Python>>正文


Python CodePrinter.__init__方法代码示例

本文整理汇总了Python中sympy.printing.codeprinter.CodePrinter.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python CodePrinter.__init__方法的具体用法?Python CodePrinter.__init__怎么用?Python CodePrinter.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sympy.printing.codeprinter.CodePrinter的用法示例。


在下文中一共展示了CodePrinter.__init__方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from sympy.printing.codeprinter import CodePrinter [as 别名]
# 或者: from sympy.printing.codeprinter.CodePrinter import __init__ [as 别名]
 def __init__(self, settings={}):
     CodePrinter.__init__(self, settings)
     self.known_functions = dict(known_functions)
     userfuncs = settings.get('user_functions', {})
     self.known_functions.update(userfuncs)
     self._dereference = set(settings.get('dereference', []))
     self.reserved_words = set(reserved_words)
开发者ID:bjodah,项目名称:sympy,代码行数:9,代码来源:rust.py

示例2: __init__

# 需要导入模块: from sympy.printing.codeprinter import CodePrinter [as 别名]
# 或者: from sympy.printing.codeprinter.CodePrinter import __init__ [as 别名]
 def __init__(self, settings={}):
     """Register function mappings supplied by user"""
     CodePrinter.__init__(self, settings)
     self.known_functions = dict(known_functions)
     userfuncs = settings.get('user_functions', {})
     for k, v in userfuncs.items():
         if not isinstance(v, list):
             userfuncs[k] = [(lambda *x: True, v)]
     self.known_functions.update(userfuncs)
开发者ID:B-Rich,项目名称:sympy,代码行数:11,代码来源:ccode.py

示例3: __init__

# 需要导入模块: from sympy.printing.codeprinter import CodePrinter [as 别名]
# 或者: from sympy.printing.codeprinter.CodePrinter import __init__ [as 别名]
 def __init__(self, settings=None):
     CodePrinter.__init__(self, settings)
     self._init_leading_padding()
     assign_to = self._settings['assign_to']
     if isinstance(assign_to, basestring):
         self._settings['assign_to'] = C.Symbol(assign_to)
     elif not isinstance(assign_to, (C.Basic, type(None))):
         raise TypeError("FCodePrinter cannot assign to object of type %s" %
                 type(assign_to))
开发者ID:jenshnielsen,项目名称:sympy,代码行数:11,代码来源:fcode.py

示例4: __init__

# 需要导入模块: from sympy.printing.codeprinter import CodePrinter [as 别名]
# 或者: from sympy.printing.codeprinter.CodePrinter import __init__ [as 别名]
 def __init__(self, settings={}):
     CodePrinter.__init__(self, settings)
     self.known_functions = dict(known_functions)
     userfuncs = settings.get('user_functions', {})
     self.known_functions.update(userfuncs)
     # leading columns depend on fixed or free format
     if self._settings['source_format'] == 'fixed':
         self._lead_code = "      "
         self._lead_cont = "     @ "
         self._lead_comment = "C     "
     elif self._settings['source_format'] == 'free':
         self._lead_code = ""
         self._lead_cont = "      "
         self._lead_comment = "! "
     else:
         raise ValueError("Unknown source format: %s" % self._settings[
                          'source_format'])
     standards = set([66, 77, 90, 95, 2003, 2008])
     if self._settings['standard'] not in standards:
         raise ValueError("Unknown Fortran standard: %s" % self._settings[
                          'standard'])
开发者ID:AdrianPotter,项目名称:sympy,代码行数:23,代码来源:fcode.py

示例5: __init__

# 需要导入模块: from sympy.printing.codeprinter import CodePrinter [as 别名]
# 或者: from sympy.printing.codeprinter.CodePrinter import __init__ [as 别名]
 def __init__(self, **kwargs):
     """Register function mappings supplied by user"""
     CodePrinter.__init__(self, kwargs)
     self.known_functions = dict(known_functions)
开发者ID:jwpeterson,项目名称:moose,代码行数:6,代码来源:fparser.py

示例6: __init__

# 需要导入模块: from sympy.printing.codeprinter import CodePrinter [as 别名]
# 或者: from sympy.printing.codeprinter.CodePrinter import __init__ [as 别名]
 def __init__(self, settings={}):
     CodePrinter.__init__(self, settings)
     self.known_functions = dict(known_functions)
     userfuncs = settings.get('user_functions', {})
     self.known_functions.update(userfuncs)
开发者ID:abhi98khandelwal,项目名称:sympy,代码行数:7,代码来源:jscode.py


注:本文中的sympy.printing.codeprinter.CodePrinter.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。