Exemplo n.º 1
0
    def saveDoc(doc: Doc):
        """Сохранение данных"""

        # Сдесь почему-то не получилось сохранять
        # Обьект Doc целиком
        # Поэтому превращаю словарь в список и сохраняю в файл
        result = []
        for key, figure in doc.all().items():
            result.append(figure)

        output = open(Data.__file_name, 'wb')
        pickle.dump(result, output)
        output.close()