전체 글(178)
-
[Raspberry Pi 4] Setup SPI
GPIO를 이용해 SPI 통신을 하려했더니 `/dev/spidev0.0 does not exist` 라는 문구가 뜬다. 이 문제를 해결하기위해 SPI 세팅을 해주자. 1. Open Raspberry Pi Configsudo raspi-config 위의 명령어를 입력하여 Config를 연다. 2. Setup SPI 이후 SPI 연결을 하면 더이상 `/dev/spidev0.0 does not exist` 라는 문구가 뜨지 않는다.
2024.09.22 -
[Raspberry Pi 4] Fix Keyboard Input
라즈베리파이OS를 세팅한 후, 파이썬 코드에 주석을 입력하기 위해 `#`를 입력했더니 기대하던 동작이 아닌 ` €`이 입력되었다. 이런 문제를 해결하는 방법을 기술한다. 1. 라즈베리파이의 설정 열기sudo raspi-config 커맨드창을 열어 위의 명령어를 입력한다. 위와 같은 화면이 나온다면 성공이다. 2. 키보드 설정 이후 엔터키를 누르다보면 설정이 완료된다. 이렇게 세팅이 완료되며, 정상적으로 `#`이 입력된다.
2024.09.22 -
[Raspberry Pi 4] Setup Raspberry Pi OS at micro SD Card
https://www.raspberrypi.com/software/ 맨처음 올린 링크의 홈페이지에 접속하면 위와 같은 모습이 나온다.여기서 `Download for Windows`를 눌러 프로그램을 다운로드 및 설치를 한 뒤 micro SD Card를 연결한다. 이후 아래의 스크린샷을 따라 차근차근 진행하면 된다. 이렇게 Raspberry Pi의 OS Install 과정이 완료된다.
2024.09.22 -
[macOS] 전원 연결 없이 클램쉘 모드 사용하기
화면 덮개를 닫을 경우 자동으로 절전 모드에 진입하는데, 이를 막아주는 스크립트를 사용하면 클램쉘 모드가 작동한다. 클램쉘 모드 설정do shell script "pmset -b disablesleep 1" with administrator privileges 클램쉘 모드 해제do shell script "pmset -b disablesleep 0" with administrator privileges
2024.09.17 -
[macOS] MOS - 마우스 관련 서드파티 앱
https://mos.caldis.me/ MOS | A lightweight tool used to smooth scrolling and set scroll direction independently for your mouse on MacOSScrolling, Smoother Than Ever Mos's special interpolation algorithm can make every mouse roll as smooth and silky as possible.mos.caldis.me 애플의 매직 마우스가 아닌 일반 마우스로도 부드러운 스크롤이 가능하게 만든다.
2024.09.17 -
[Error] PyInstaller - IndexError: tuple index out of range
PyInstaller를 통해 윈도우 실행 파일을 만들려고 했더니 위와 같은 에러가 발생했다. 이 문제는 Python 3.10 버전에 있는 이슈라고 한다. 이 문제를 해결하는 방법은 파이썬이 설치되어있는 폴더의 Lib 폴더로 이동한다. 만약 설치 폴더를 알 수 없다면 프롬프트 창을 열어서 파이썬 대화형 인터프리터 기능을 사용한다. C:\Windows\System32>pythonPython 3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> import sys>>> s..
2024.09.11 -
30970 선택의 기로 - Python
1. 풀이 코드N = int(input())quality = []quantity = []for _ in range(N): qual, quan = map(int, input().split(' ')) quality.append([qual, quan]) quantity.append([quan, qual])quality.sort(key=lambda x: (-x[0], x[1]))quantity.sort(key=lambda x: (x[0], -x[1]))# print(quality)# print(quantity)print(f"{quality[0][0]} {quality[0][1]} {quality[1][0]} {quality[1][1]}")print(f"{quantity[0][1]} {quanti..
2024.08.06 -
26150 Identify, Sort, Index, Solve - Python
1. 풀이 코드N = int(input())answer = ["0"] * Ntemp_list = []for i in range(N): message, num_i, num_d = input().split(' ') temp_list.append([int(num_i), num_d, message])temp_list.sort()for i in range(N): j = int(temp_list[i][1]) - 1 # print(j, temp_list[i][2]) answer[i] = temp_list[i][2][j].upper()print(''.join(answer)) 디버깅으로 사용한 코드는 주석처리하였습니다. 2. 다른 사람 풀이 코드for i,j,k in sorted(map(st..
2024.08.06 -
1384 메시지 - Python
1. 풀이 코드num = 0while True: is_bullying = False n = int(input()) num += 1 if n == 0: break people_list = [] for i in range(n): paper = list(input().split(' ')) people_list.append(paper) print(f"Group {num}") for i in range(n): target = people_list[i] for j in range(n): if target[j] == "N": is_bullying..
2024.08.06 -
23882 알고리즘 수업 - 선택 정렬 2 - Python
1. 풀이 코드change_count = 0N, K = map(int, input().split(' '))num_list = list(map(int, input().split(' ')))i = 0is_search = Falsewhile True: target_num = num_list[N-1-i] if N-1-i == 0: break next_max_num = max(num_list[:N-1-i]) if target_num 2. 다른 사람 풀이 코드a, b = map(int, input().split())lst = list(map(int, input().split()))count = 0for i in range(a-1, 0, -1): max_index = ls..
2024.08.06