How can I change the following line of code (which reads the parameter names in config_file
):
re.findall('Parameter.*', config_file)
to ignore lines containing comment character ( %
) left? that is, in the following example,
Parameter: A
%Parameter: B
% Parameter: C
Parameter: D %the best parameter
only A and D match?
source
share