Notice
Recent Posts
Recent Comments
Link
목록py (1)
가볍게 배우고 깊게 즐기고 오래 남기기
[Pyton || Tip] nbformat 라이브러리를 활용한 노트북파일(ipynb) py변환
import nbformatnotebook_path = 'name.ipynb'with open(notebook_path, 'r', encoding='utf-8') as f: notebook = nbformat.read(f, as_version=4)code_cells = [cell for cell in notebook.cells if cell.cell_type == 'code']script_content = "\n\n".join(cell.source for cell in code_cells)# Save the script to a .py filescript_path = 'name.py'with open(script_path, 'w', encoding='utf-8') as f: f.write(sc..
Programming & Tip/Python
2024. 5. 20. 14:03