Tony the Tiger <tony at tiger.invalid> writes: > # options.modus_list contains, e.g., "[2,3,4]" Try this: import ast MODUS_LIST = ast.literal_eval(options.modus_list) literal_eval is like eval except it can only evaluate literals rather than calling functions and the like. The idea is you can use it on untrusted data.