목록전체 글 (121)
가볍게 배우고 깊게 즐기고 오래 남기기

팀별 프로젝트 환경 탓에 Window / Mac OS를 왔다갔다하는 나로서는 종종 만나는 에러 VS Code 우측하단에서 CRLF를 LF 변경하면 되긴 하지만 일일이 파일 모두 세팅해줘야하는 경우들이 발생해서Git Bash로 설정 시작 ★ Window나 Git에서 전체 파일의 줄 끝을 LF(Line Feed)로 강제설정하는 방법 Git 설정 변경: 먼저 Git의 전역 설정을 변경하여 자동 변환을 비활성화git config --global core.autocrlf false".gitattributes" 파일 생성: 프로젝트 루트 디렉토리에 위치 - 여기까지 오신 분중에 모르시는 분은 없겠지만 노파심에 - Notepad 또는 VS code New file로 생성 모든 텍스트 파일의 줄 끝을 LF로 강제 설..
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..
git fetch --prune origin git reset --hard origin/main