How can I modify the following line of code (which reads the names of parameters in config_file
):
re.findall('Parameter.*', config_file)
so as to ignore lines containing a comment symbol (%
) to the left? i.e. in the following example,
Parameter: A
%Parameter: B
% Parameter: C
Parameter: D %the best parameter
only A and D match?