Re: [Tutor] Given a string, call a function of that name

2017-05-17 Thread boB Stepp
On Wed, May 17, 2017 at 1:42 AM, Peter Otten <__pete...@web.de> wrote: > boB Stepp wrote: >> Oh, and I suppose I should ask for a critique of the code as written >> for appropriate Python style, proper targeted function use, etc. I am >> always eager to learn! > >> if function in valid_fcns:

Re: [Tutor] Given a string, call a function of that name

2017-05-17 Thread Alan Gauld via Tutor
On 17/05/17 03:49, boB Stepp wrote: > corresponding to one of his functions or methods, if he could use that > word to run a function of the same name. I said I had done something > once where I used the word as a dictionary key, which was then used to > call the function. That's the usual appr

Re: [Tutor] Given a string, call a function of that name

2017-05-16 Thread Peter Otten
boB Stepp wrote: > My son (Now 13 years old.) is merrily programming away in Python 3 (Of > course!) and has many projects he is working on. Today he resumed > work on his efforts to create a natural language parser, which he > hopes will enable people to type in commands to a DnD-like game using

[Tutor] Given a string, call a function of that name

2017-05-16 Thread boB Stepp
My son (Now 13 years old.) is merrily programming away in Python 3 (Of course!) and has many projects he is working on. Today he resumed work on his efforts to create a natural language parser, which he hopes will enable people to type in commands to a DnD-like game using natural English. An ambi