Reading or modifying a list of options in .prc

I want to read user property with a list of values in the config.prc like this:

bind-laser-fire 1 space

Or like this:

bind-laser-fire 1
bind-laser-fire space

How do we read these value lists?

And how do we change one of these values programaticaly?

Thanks in advance.

You can always get the variable as a string, in the first case, and then use the Python split() function to separate it up into words:

v = ConfigVariableString('bind-laser-fire', '')
words = v.getValue().split(' ')

If you want to support the second case, use ConfigVariableList instead:

v = ConfigVariableList('bind-laser-fire')
for i in v.getNumValues():
  word = v[i]

David