본문 바로가기

728x90
반응형

전체 글

(256)
pdf -> ppt 변환 사이트 (pdf to ppt converter) https://abcdpdf.com/ko/ ABCD PDF 온라인 변환 도구 - 100% 무료 ABCDPDF는 100% 무료 올인원 PDF 도구입니다. 유용한 PDF 변환기 툴킷과 온라인 오피스 제품군으로 생산성을 높여드립니다. abcdpdf.com
systemd in wsl2 # System has not been booted with systemd as init system (PID 1). Can't operate. System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down Systemd는 Linux 기반 운영 체제를 위한 시스템 및 서비스 관리자 기본적으로 wsl에서 systemd 지원이 되지 않았었고, 그때문에 wsl에서 systemd와 관련된 설정이 되어 있지 않아 이런 문제가 발생 저 같은 경우는 redis를 wsl에서 설치하기 위해 linux에 redis를 설치하는 방법을 참고해서 진행했습니다.설치 후에 redis의 설정 파일에 systemd를 사용하도록 설정을 건드렸는데, 이 이후부터 에러가 발생했습니다.구체적으로는 systemctl status redis..
python: sort a list of dictionaries by a value list에 담긴 json 형태의 dictionary 들을 특정 value에 따라 정렬을 해야할 때가 있습니다. python 내장함수인 operator를 활용하면 아주 용이하게 할 수 있습니다. import operator list_of_dict = [ {'id': 1, 'name': 'Kim', 'age':10}, {'id': 2, 'name': 'Ju', 'age':30}, {'id': 3, 'name': 'Jang', 'age':20}, ] list_of_dict.sort(key=operator.itemgetter('name')) print(list_of_dict) list_of_dict.sort(key=operator.itemgetter('age')) print(list_of_dict) list_o..
(python) remove list elements in for loop # for 문에서 list의 요소 제거 list에서 element를 제거할 때는 특정 index의 element를 제거하거나 특정 value의 element를 제거할 수 있습니다. * index 기준 1) del list에서 삭제만 하는게 필요한 경우는 del을 이용하면 됩니다. fruits = ['apple', 'banana', 'peach'] del fruits[1] print(fruits) ['apple', 'peach'] fruits = ['apple', 'banana', 'peach'] del fruits[1:3] print(fruits) ['apple'] 2) list에서 삭제하고, 삭제한 값을 뽑아서 사용하려는 경우는 pop을 이용 fruits = ['apple', 'banana', 'peach'] p = fruits.pop(1)..
레디스게이트 http://redisgate.kr/redisgate/ent/ent_intro.php Redis-Enterprise Introduction ent_intro 레디스 엔터프라이즈 레디스 엔터프라이즈 서버의 주요 기능 I. Active-Active 이중화 : 진정한 고가용성을 실현 II. Redis + SQL : 데이터 활용 획기적 향상 III. 기타 추가 기능: 멤버 단위 만 redisgate.kr redis에 대한 좋은 글들이 많이 있는 사이트
django ORM list filter : __in Django ORM filter를 이용하면 원하는 field에 해당하는 정보만 가져올 수 있습니다. 이때 원하는 filter 조건을 list로 줘서, 그 list에 해당하는 정보들을 filtering 하는 방법이 있습니다. field fruit을 갖는 Food라는 table이 있다고 할 때, fruit이 apple, banna, peach 중에서 apple, banana를 갖는 것들만 가져오고 싶다고 하면 다음과 같이 하면 됩니다. wanted_list = ['apple', 'banana'] Food.objects.filter(fruit__in=wanted_list)
python file, directory 경로 / file , directory 여부 확인 Python에서 1) file, directory의 경로를 쉽게 찾을 수 있는 방법 import os os.walk() os.listdir() 2) file인지 directory인지 구분을 하는 방법을 찾아봅시다. file인지 directory인지 구분은 왜 해야 할까요? 여러 파일과 폴더가 있는 경로에서 특정 조건의 파일을 열려고 할 때, directory를 file처럼 열어서 처리하려고 하면 file이 아니기 때문에 다음과 같은 error를 마주하게 됩니다. IsADirectoryError: [Errno 21] Is a directory: 파일인지 확인 import os os.path.isfile(file) 디렉토리(폴더)인지 확인 import os os.path.isdir(file)
list index: list에서 특정 값의 순서 찾기 python list index fruits = ['apple', 'banana', 'peach'] banana_index = fruits.index('banana') print(banana_index) 결과값 1

728x90
반응형