View Single Post
Old Nov 25th, 2006, 9:07 PM   #2
Darkhack
Hobbyist Programmer
 
Darkhack's Avatar
 
Join Date: Dec 2005
Location: Kansas City
Posts: 105
Rep Power: 3 Darkhack is on a distinguished road
Send a message via AIM to Darkhack
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.
Darkhack is offline   Reply With Quote