Saves the tree to the current working directory under the given file name in JSON.
(self)
| 88 | self.save2file(f'{file_name}.txt') |
| 89 | |
| 90 | def saveJSON(self) -> None: |
| 91 | """ |
| 92 | Saves the tree to the current working directory under the given file name in JSON. |
| 93 | """ |
| 94 | json_data = self._to_json() |
| 95 | file_name = self._get_tree_file_name() |
| 96 | with open(f'{file_name}.json', 'w+') as f: |
| 97 | f.write(json_data) |
| 98 | |
| 99 | def _to_json(self) -> str: |
| 100 | json_data = self.to_json() |
no test coverage detected