本文整理汇总了Python中org.python.core.Py.getCompilerFlags方法的典型用法代码示例。如果您正苦于以下问题:Python Py.getCompilerFlags方法的具体用法?Python Py.getCompilerFlags怎么用?Python Py.getCompilerFlags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.python.core.Py
的用法示例。
在下文中一共展示了Py.getCompilerFlags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: compile_command
# 需要导入模块: from org.python.core import Py [as 别名]
# 或者: from org.python.core.Py import getCompilerFlags [as 别名]
def compile_command(source, filename="<input>", symbol="single"):
r"""Compile a command and determine whether it is incomplete.
Arguments:
source -- the source string; may contain \n characters
filename -- optional filename from which source was read; default
"<input>"
symbol -- optional grammar start symbol; "single" (default) or "eval"
Return value / exceptions raised:
- Return a code object if the command is complete and valid
- Return None if the command is incomplete
- Raise SyntaxError, ValueError or OverflowError if the command is a
syntax error (OverflowError and ValueError can be produced by
malformed literals).
"""
if symbol not in ['single','eval']:
raise ValueError,"symbol arg must be either single or eval"
return Py.compile_command_flags(source,filename,symbol,Py.getCompilerFlags(),0)