|
I would read up on parsers or interpreters. Complexity is also a big part of it. You might think of having a tokenizer if you plan to have long or complex commands. Otherwise a simple <command attrib1 attrib2 attrib3> could be done with simple string parsing.
I'm not familiar with Python myself but read the string and seperate each word in an array. Item zero would be your command and the rest would be the attributes passed to it. From there you can use a series of if-statements to determine what functions to use.
|