Alan Gauld via Tutor wrote: >>exec() might even be a way > > It's a way but it's a bad way! :-)
And then > A simple approach you could use would be to get Python to > generate a new python file(module) containing the required class > definition (simple string processing) and then dynamically > import the new file. That's basically exec(), with better tracebacks and a higher chance to run outdated code ;) By the way I don't think exec() is bad as long as you control its input and as long as this input is fairly simple. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor