def pysub(arg, line, num):
"""substitutes the return value of a python statement for an arg"""
namespace.update(l=line)
value = eval(arg, namespace)
# return multiple args if the return value is a list, tuple or iterator
if isinstance(value, (list, tuple, collections.Iterator)):
return value
return [str(value)]
评论列表
文章目录