전체 글

박정수가 공부한 자료를 남기기 위한 블로그
dev/기타

python - 폴더 내부의 파일 utf-8로 인코딩 변경 코드

#pip install chardet import os import chardet def convert_to_utf8(file_path): try: with open(file_path, 'rb') as f: content = f.read() encoding = chardet.detect(content)['encoding'] if encoding and not 'utf-8' in encoding.lower() : contents = content.decode(encoding) #contents = contents.encode('UTF-8') #contents = contents.replace('\r\n\r\n','\r\n') with open(file_path, 'w', encoding='UTF-8',ne..

dev/기타

특정 코드 존재시 아래의 코드 추가하는 파이썬 코드

import os import sys # 찾을 문자열 search_text = 'AddGridColumn("PRODUCTSPECNAME' root_dir = "./" # 현재 디렉토리에서 모든 폴더 탐색 for root, dirs, files in os.walk(root_dir,topdown=False): # 모든 파일 탐색 for file in files: # 파일 열기 if file == 'python.py': continue elif not file.endswith('.cs'): continue elif file.endswith('Designer.cs'): continue with open(os.path.join(root, file), "r",encoding='UTF-8') as f: # 파일의 내..

유용한 사이트 모음집

데이터 베이스 잘 정리된 위키 사이트

http://dbcafe.co.kr/wiki/index.php/%EB%8C%80%EB%AC%B8 DB CAFE DBCAFE (http:// [dbcafe.co.kr] :: sensing) visited local_dining 디비 카페 - 데이터 전문가로 가는 길 notifications_active 주제별 등록건수 / 총 865건 오라클: 437 건 / 파이썬: 67 건 / R : 14 건 / MySQL: 16 건 / Window: 12 dbcafe.co.kr

jeongsu
Park_jeong_su