tlpipe.kiyopy.parse_ini.write_params

tlpipe.kiyopy.parse_ini.write_params(params, file_name, prefix='', mode='w')[source]

Write a parameter dictionary to file.

Given a dictionary of parameters, such as one of the ones read br the parse function, this program writes a compatible ini file.

This should work if the parameters are built in types, but no promises for other types. Basically if the out put of ‘print param’ looks like it could go on the rhs of the assignment operator, you are in good shape.

Parameters:
  • params (dict) – A dictionary of parameter names and values to be written to file.
  • file_name (string) – File name to write to.
  • prefix (string) – Prefix for the parameter names when written to file.
  • mode (string) – Whether to open the file in write or append mode. Can be ‘a’ or ‘w’.