newbie: generate a function based on an expression
def genFun(expr, locs): ... return lambda x: eval('min(Max,max(Min,%s))' % expr, locs, {'x': x}) ... fun = genFun(A*x+off, {'A': 3.0, 'off': -0.5, 'Max': 2.0, 'Min': -2.0} ) fun function lambda at 0x011B1470 fun(0) -0.5 fun(-10) -2.0 fun(10) 2.0 -- http://mail.python.org/mailman/listinfo/python-list
pyparsing and LaTeX?
Anyone parsing simple LaTeX constructs with pyparsing? Greetings Tim, Have always wanted a way to parse LaTeX myself. Unfortunately, I have been moved to a different project. However, I am still very much interested. Did you ever get a reply? -- http://mail.python.org/mailman/listinfo/python-list
Re: what's wrong with lambda x : print x/60,x%60
Try lambda_hrs = lambda x: (x/60,x%60) -- http://mail.python.org/mailman/listinfo/python-list
get current function name
See module inspect -- http://mail.python.org/mailman/listinfo/python-list