>>> 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
at 0x011B1470>
>>> fun(0)
-0.5
>>> fun(-10)
-2.0
>>> fun(10)
2.0
>>>
--
http://mail.python.org/mai
> 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-l
Try
lambda_hrs = lambda x: (x/60,x%60)
--
http://mail.python.org/mailman/listinfo/python-list
See module inspect
--
http://mail.python.org/mailman/listinfo/python-list