def _writeToFile(out_model_dict, model_directory, parent): fname = QFileDialog.getSaveFileName(parent, "Save to file", model_directory)[0] if len(fname) > 0: # enforce correct suffix. if not fname.endswith(".yaml"): fname += ".yaml" f = open(fname, "w") yaml.dump(out_model_dict, f, default_flow_style=False) f.close()
def _writeToFile(out_model_dict, model_directory, parent): fname = QFileDialog.getSaveFileName(parent, 'Save to file', model_directory)[0] if len(fname) > 0: # enforce correct suffix. if not fname.endswith(".yaml"): fname += ".yaml" f = open(fname, "w") yaml.dump(out_model_dict, f,default_flow_style=False) f.close()
def _writeToFile(expression_string, model_directory, parent, header): fname = QFileDialog.getSaveFileName(parent, 'Export to .py file', model_directory)[0] if len(fname) > 0: # enforce correct suffix. if not fname.endswith(".py"): fname += ".py" f = open(fname, 'w') f.write(header) f.write(expression_string) f.close()