Hi. I haven't been able to get Python to work at all in Construct lately (not sure why, but may be due to re-installing Windows XP, somehow), so I can't test whether I can get that to work.
One thing that comes to mind: If you are using the 'System->Run Script' action or the 'System->Evaluate python command' expression, which must have the command enclosed in double-quotes("), then you should use the single-quotes (') around strings within those. No need to worry about that if you are inserting the script into the event sheet, though.
It may just not work, in which case you can roll your own with Python, if you like. For example, this would be very similar:
[code:lynp8a7d]def getToken(string, num, delimiter=','):
It handles out-of-range indexes by returning empty strings, but indexes are zero-based instead of one-based, as Construct uses. It also allows negative indexes, which count backward from the end.
You can include your own functions like that by adding them into a 'Start of Layout' condition, since they need only be defined once.