Which is cool, obviously, if you like algorithms that manipulate other algorithmic-generated algorithms.
http://xkcd.com/917/ |
exec open(PATH).read() in globals()
where PATH points to the program-generated file that contains the data structures and the functions I need. Again, the elegance and conciseness of Python are astonishing: exec command checks the syntax and interprets the content of the file, after having it read with read() method, and all the variables are kept in globals namespace.
One-liner power!
No comments:
Post a Comment