Using eval with substitutions
abhishek at ocf.berkeley.edu
abhishek at ocf.berkeley.edu
Fri Sep 1 22:16:01 EDT 2006
Thanks very much for all your suggestions - Peter, Duncan and Frederic.
It was a great help.
Incidentally the question arose while I was trying to solve the 2-nots
problem,
http://www.inwap.com/pdp10/hbaker/hakmem/boolean.html#item19
Part of my program takes a set of boolean expressions in 3 variables
and keeps concatenating them with 'and' and 'or' until all unique
functions have been found. Sometimes it is good to use substitutions
(though not required) to make the patterns apparent. Anyway, the
listing is here,
http://www.ocf.berkeley.edu/~abhishek/twonot3.py
Abhishek
More information about the Python-list
mailing list