Remove magic from ipynb before serving
This commit is contained in:
parent
bf7982c56b
commit
349d4b4201
1 changed files with 2 additions and 0 deletions
|
|
@ -139,6 +139,8 @@ def get_script_name(file_name_argument: str) -> str:
|
|||
|
||||
exporter = PythonExporter()
|
||||
content, _ = exporter.from_filename(file_name_argument)
|
||||
content = re.sub(r".*get_ipython\(.*", "", content)
|
||||
|
||||
file_name_argument = get_script_name_of_notebook(file_name_argument)
|
||||
|
||||
with open(file_name_argument, "w", encoding="utf-8") as f:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue