"Homme, James" <[email protected]> wrote

If you can get away with not telling me the answer, but pointing
me to where to look for the answer, I'd be grateful.

OK, Don't use eval or exec they have secuity issues - especially if reading the
strings from a file!

idea is to read in strings from a file, look one up,
and use it to execute a function.

Functions are objects sop can be stored as data.
Dictionariers can associate strings with arbitrary data - including functions.

Is that enough of a hint? :-)

If not, try reading the OOP topic in my tutorial, under the section heading "Collections of Objects" where I discuss the related scenario of managing
collections of objects with arbitrary (or user assigned) names/IDs.

--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to