I have a Rhinoscript that does this now, but my experience with Python so far is only enough to make me think that there is probably an easier way to do this than to mimic the Rhinoscript idea.
This is an example of “tuple unpacking”. You can have functions that output multiple objects (in the form of a tuple) and assign them to multiple variables… n, command = line.split(' ') assumes that there will be exactly be two strings returned by split, the first will be assigned to n, the second to command. The n, command is an “implied tuple”: really (n, command).
The problem here is that the number of variables must always correspond to the number of objects returned; otherwise the unpacking will fail. If there are more or less returned strings in the output - say there is a second space somewhere, which will make it split into three substrings - the function will fail, so it’s not extremely robust with unknown data.