thdl.utils.file.write_xls(contents, filepath)[source]

Write the contents into the xls tables.

  • contents – an instance of dict or an instance of list. If isinstance(contents, dict) == True, there is only one line in xls table. If contents is a list, then there are several lines in xls table.
  • filepathstr instance. The path to save.
thdl.utils.file.pickle_dump(data, path)[source]

Given the DATA, then pickle it into the PATH.

  • data – the f_data to pickle.
  • path – the path to store the pickled f_data.

From the PATH get the DATA.

Parameters:path – the path that store the pickled f_data

Check the duplicate path.

If there is a same filepath, for example ‘file/tests.txt’, Then this path will be ‘file/tests(1).txt’

If ‘file/tests(1).txt’ also exists, then this path will be ‘file/tests(2).txt’

Parameters:filepath – the file path to save.
Returns:the file path can be used to save path.