save jupyter file

This commit is contained in:
lidanyang 2023-12-12 10:30:05 +08:00
parent 4634415e37
commit fd31cc065a

View file

@ -156,6 +156,11 @@ class ExecutePyCode(ExecuteCode, Action):
return code, language
def save_notebook(self, path: str):
path = Path(path)
path.parent.mkdir(parents=True, exist_ok=True)
nbformat.write(self.nb, path)
async def run(self, code: Union[str, Dict, Message], language: str = "python") -> Tuple[str, bool]:
code, language = self._process_code(code, language)