本文整理汇总了Python中numpy.distutils.misc_util.is_sequence方法的典型用法代码示例。如果您正苦于以下问题:Python misc_util.is_sequence方法的具体用法?Python misc_util.is_sequence怎么用?Python misc_util.is_sequence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类numpy.distutils.misc_util
的用法示例。
在下文中一共展示了misc_util.is_sequence方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _check_append_ext_library
# 需要导入模块: from numpy.distutils import misc_util [as 别名]
# 或者: from numpy.distutils.misc_util import is_sequence [as 别名]
def _check_append_ext_library(libraries, lib_name, build_info):
for item in libraries:
if is_sequence(item):
if item[0]==lib_name:
if item[1] is build_info:
return
warnings.warn("[3] libraries list contains %r with"
" different build_info" % (lib_name,),
stacklevel=2)
break
elif item==lib_name:
warnings.warn("[4] libraries list contains %r with"
" no build_info" % (lib_name,),
stacklevel=2)
break
libraries.append((lib_name, build_info))
示例2: _check_append_library
# 需要导入模块: from numpy.distutils import misc_util [as 别名]
# 或者: from numpy.distutils.misc_util import is_sequence [as 别名]
def _check_append_library(libraries, item):
for libitem in libraries:
if is_sequence(libitem):
if is_sequence(item):
if item[0]==libitem[0]:
if item[1] is libitem[1]:
return
warnings.warn("[0] libraries list contains %r with"
" different build_info" % (item[0],))
break
else:
if item==libitem[0]:
warnings.warn("[1] libraries list contains %r with"
" no build_info" % (item[0],))
break
else:
if is_sequence(item):
if item[0]==libitem:
warnings.warn("[2] libraries list contains %r with"
" no build_info" % (item[0],))
break
else:
if item==libitem:
return
libraries.append(item)
示例3: _check_append_library
# 需要导入模块: from numpy.distutils import misc_util [as 别名]
# 或者: from numpy.distutils.misc_util import is_sequence [as 别名]
def _check_append_library(libraries, item):
for libitem in libraries:
if is_sequence(libitem):
if is_sequence(item):
if item[0]==libitem[0]:
if item[1] is libitem[1]:
return
warnings.warn("[0] libraries list contains %r with"
" different build_info" % (item[0],),
stacklevel=2)
break
else:
if item==libitem[0]:
warnings.warn("[1] libraries list contains %r with"
" no build_info" % (item[0],),
stacklevel=2)
break
else:
if is_sequence(item):
if item[0]==libitem:
warnings.warn("[2] libraries list contains %r with"
" no build_info" % (item[0],),
stacklevel=2)
break
else:
if item==libitem:
return
libraries.append(item)
示例4: _check_append_ext_library
# 需要导入模块: from numpy.distutils import misc_util [as 别名]
# 或者: from numpy.distutils.misc_util import is_sequence [as 别名]
def _check_append_ext_library(libraries, lib_name, build_info):
for item in libraries:
if is_sequence(item):
if item[0]==lib_name:
if item[1] is build_info:
return
warnings.warn("[3] libraries list contains %r with"
" different build_info" % (lib_name,))
break
elif item==lib_name:
warnings.warn("[4] libraries list contains %r with"
" no build_info" % (lib_name,))
break
libraries.append((lib_name, build_info))
示例5: _exec_command
# 需要导入模块: from numpy.distutils import misc_util [as 别名]
# 或者: from numpy.distutils.misc_util import is_sequence [as 别名]
def _exec_command(command, use_shell=None, use_tee = None, **env):
"""
Internal workhorse for exec_command().
"""
if use_shell is None:
use_shell = os.name=='posix'
if use_tee is None:
use_tee = os.name=='posix'
if os.name == 'posix' and use_shell:
# On POSIX, subprocess always uses /bin/sh, override
sh = os.environ.get('SHELL', '/bin/sh')
if is_sequence(command):
command = [sh, '-c', ' '.join(command)]
else:
command = [sh, '-c', command]
use_shell = False
elif os.name == 'nt' and is_sequence(command):
# On Windows, join the string for CreateProcess() ourselves as
# subprocess does it a bit differently
command = ' '.join(_quote_arg(arg) for arg in command)
# Inherit environment by default
env = env or None
try:
proc = subprocess.Popen(command, shell=use_shell, env=env,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True)
except EnvironmentError:
# Return 127, as os.spawn*() and /bin/sh do
return 127, ''
text, err = proc.communicate()
# Another historical oddity
if text[-1:] == '\n':
text = text[:-1]
if use_tee and text:
print(text)
return proc.returncode, text