split("' '")
Will split on the literal sequence of three characters single quote, space, single quote, which don't appear in your command
strings.
I think you will need to approach this more like:
command, content = command.split(" ", 1)
if command == "plot":
plot(command[1:-1])
elif command == "set":
item, content = content.split(" ", 1)
if item == "title":
title = content[1:-1]
...
Note the use of a second argument to tell split
how many times to do so; 'set title "foo"'.split(" ", 1) == ['set', 'title "foo"']
. Precisely how you implement will depend on the range of things you want to be able to parse.