본문 바로가기

2020/047

[Python] psycopg2 에서 실행된 쿼리문 전체 보기 import psycopg2 as pg2 from psycopg2.extras import DictCursor conn = pg2.connect() cursor = conn.cursor(cursor_factory=DictCursor) cursor.execute('select %s, %s', ('test', 2)) cursor.query "select E'test', 2" 2020. 4. 29.
[VueJs] CKEditor 연동하기 // 설치 npm i --save @ckeditor/ckeditor5-vue @ckeditor/ckeditor5-build-classic // package.json 확인 "dependencies": { "@ckeditor/ckeditor5-build-classic": "^16.0.0", "@ckeditor/ckeditor5-vue": "^1.0.1" } // template 파일 샘플 팁 언어를 한국어(ko) 로 지정을 해도 메뉴들이 여전히 영어로 나올 경우, 한국어를 직접 참조할 수 있도록 추가 import '@ckeditor/ckeditor5-build-classic/build/translations/ko'; 참조 URL : https://ckeditor.com/docs/ckeditor5/lates.. 2020. 4. 27.
[GIT] 윈도우 PowerShell 에서 git clone 후 github desktop에서 보기 git desktop 설치 : https://desktop.github.com/ git clone으로 소스 가져오기 // 빈 디렉토리 만들고 powershell 호출 // repository clone git clone ssh://[gituser]@[gitlab server]/[gitlab reopsitory] // github desktop 실행 File > Add local repository 클릭 repository 디렉토리 선택 2020. 4. 27.
[Python] 이름으로 특정 프로세스 종료 시키기 보통 콘솔에서 동작을 시킬때 동일한 프로그램이 좀비형태로 안죽고 있거나, 일정 시간 오버해서 동작하는 경우 강제로 종료시켜야할 필요성이 있을때 사용하면 유용합니다. import psutil # python filename.py로 실행된 프로세스를 찾음 for proc in psutil.process_iter(): try: # 프로세스 이름, PID값 가져오기 processName = proc.name() processID = proc.pid if processName[:6] == "python": // 윈도우는 python.exe로 올라옴 commandLine = proc.cmdline() # 동일한 프로세스 확인. code 확인 if 'filename.py' in commandLine: parent_p.. 2020. 4. 27.
[VueJs] component 에서 벗어날때 이벤트 처리하기 페이지 이동 전에 특정 이벤트를 처리하고 싶은 경우가 있는 경우 유용합니다. // component LIFECYCLE components: { ... }, mounted: { ... } methods: { ... }, beforeRouteLeave (to, from, next) { ... } // 컴포넌트를 벗어나는 경우 처리할 이벤트 // 샘플 beforeRouteLeave(to, from, next) { const answer = window.confirm('데이터 저장이 되지 않았습니다. 이 페이지를 나가시겠습니까?') if (answer) { next() } else { next(false) // false를 추가한 경우 페이지 이동을 하지 않음 } } 2020. 4. 26.
[Python] 엑셀 처리 방법 pip install openpyxl 디렉토리 내의 엑셀 파일 목록 전체를 읽어서 분석하기 코드 일부 import openpyxl import os dirList = [ 'D:\\admin', 'D:\\front' ] currentNo = 0 def analsysEcxcel(filename, currentNo): # 엑셀파일 열기 wb = openpyxl.load_workbook(filename) # 현재 Active Sheet 얻기 ws = wb.active # Active Sheet 지정하기 # ws = wb.get_sheet_by_name("Sheet1") # 국영수 점수를 읽기 for r in ws.rows: row_index = r[0].row # 행 인덱스 if row_index < 2: # .. 2020. 4. 16.
[VSCode] sftp + euckr 파일 원격 수정 ftp-simple 원격 FTP 연결 플러그인 ftp-simple 설치 Setting > Command-Palette 클릭 > ftp-simple 검색 ftp-simple: Config - FTP connection setting 선택 [ { "name": "service_name", "host": "domain", "port": 22, "type": "sftp", "username": "ID", "password": "비밀번호", "path": "/home/", // 원격지 디렉토리 위치 "autosave": true, "confirm": true // 저장할때마다 OK 창 뜨는 것이 귀찮으면 false로 변경 } ] ftp-simple 실행: Remote directory open to workspace 파일을 수정하고.. 2020. 4. 7.
반응형