plotiterator.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:jiveplot 作者: haavee 项目源码 文件源码
def __init__(self, expr):
        # solution found in:
        # http://stackoverflow.com/questions/10303248/true-dynamic-and-anonymous-functions-possible-in-python
        self.code = compile(
                "from numpy import *\n"+
                "from math  import *\n"+
                "avg  = None\n"+
                "sd   = None\n"+
                "xmin = None\n"+
                "xmax = None\n"+
                "ymin = None\n"+
                "ymax = None\n"+
                "f   = lambda x, y: "+expr,
                'dyn-mark-string', 'exec')
        self.mod  = imp.new_module("dyn_marker_mod")
        exec self.code in self.mod.__dict__
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号