본문 바로가기
반응형

전체 글210

tkinter 버튼 그리기 import tkinter tk = tkinter window=tkinter.Tk() def show_button(): button_select = tk.Button(window, text="선택") button_next = tk.Button(window, text="다음") button_pre = tk.Button(window, text="이전") button_select.pack(side="left") button_next.pack(side="left") button_pre.pack(side="left") show_button() window.mainloop() 2022. 8. 1.
your shell has not been properly configured to use'conda activate' 2022. 4. 28.
리눅스 사용자 권한 주는 법 사용자 계정 추가 sudo adduser 계정명 권한 변경 sudo vi /etc/sudoers 명령어로 sudoers 파일 읽기 root ALL=(ALL:ALL) ALL 검색 후 바로 밑줄에 계정명 ALL = ALL=(ALL:ALL) ALL 넣어주기 sudo vi /etc/passwd 명령어로 passwd 파일 읽기 본인 계정명의 숫자를 root의 숫자와 동일하게 변경 권한 변경 sudo vi /etc/group 명령어로 group 파일 읽기 맨 윗줄 root:x:0 부분 계정명 추가 2022. 4. 26.
python (json 파일 읽기) import json import os path = os.path.join('경로') path_list = os.listdir(path) for i in path_list: file_path = path+'/'+i with open(file_path, "r", encoding='utf-8') as json_file: json_data = json.load(json_file) 2022. 4. 24.
array to json (TypeError: Object of type ndarray is not JSON serializable) class NumpyEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, np.ndarray): return obj.tolist() return json.JSONEncoder.default(self, obj) a = np.array([[1, 2, 3], [4, 5, 6]]) print(a.shape) json_dump = json.dumps({'a': a, 'aa': [2, (2, 3, 4), a], 'bb': [2]}, cls=NumpyEncoder) print(json_dump) 출처 : https://stackoverflow.com/questions/26646362/numpy-array-is-not-json-serializable 2022. 4. 24.
opencv imread error (경로 한글, 영어 섞여있음) import cv2 import numpy as np def isKorean(text): hangul = re.compile('[\u3131-\u3163\uac00-\ud7a3]+') result = hangul.findall(text) if len(result) > 0: return True else: return False if isKorean(file_path) == True: img = cv2.imread(file_path, cv2.IMREAD_COLOR) img = np.fromfile(file_path, np.uint8) img = cv2.imdecode(img, cv2.IMREAD_COLOR) elif isKorean(file_path) == False: img = cv2.imread(fil.. 2022. 4. 14.
비정형, 정형 데이터의 이미지 학습을 활용한 시장 예측 보호되어 있는 글 입니다. 2022. 4. 11.
반응형