hyperspy.misc.io.tools module

hyperspy.misc.io.tools.append2pathname(filename, to_append)

Append a string to a path name

  • filename (str) –
  • to_append (str) –
hyperspy.misc.io.tools.dump_dictionary(file, dic, string='root', node_separator='.', value_separator=' = ')

Check if the path exists and if it does not create the directory

hyperspy.misc.io.tools.incremental_filename(filename, i=1)

If a file with the same file name exists, returns a new filename that does not exists.

The new file name is created by appending -n (where n is an integer) to path name

  • filename (str) –
  • i (int) – The number to be appended.

If file exists ‘fname’, ask for overwriting and return True or False, else return True.