본문 바로가기

반응형

CodeDictionary

(4)
[파이썬 코드]이미지로 좌표 찾기 이미지로 찾아서 클릭 왼쪽 상단에서 오른쪽으로 픽셀을 검색하여 좌표를 찾음. 즉 똑같은 그림이 여러개 있다면, 가장 좌측 상단의 좌표만 리턴함. 똑같은 이미지가 없다면 FileNotFoundError import pyautogui def getCoordinateByImg(imgAddress): imgLocatedCoordinate = pyautogui.locateOnScreen(imgAddress) # 이미지가 있는 위치를 가져옵니다. if (imgLocatedCoordinate): return pyautogui.center(imgLocatedCoordinate) # 찾은 이미지의 중앙 좌표를 리턴 else: print("image never found") raise FileNotFoundError 에러..
[파이썬 코드]마우스랑 키보드 조정하기 설치법 pip install pyautogui 좌표 찾기 마우스가 이동시 1초마다 현재 마우스의 좌표를 찍어줌 import pyautogui import time while True: print("Current Mouse Position : ", pyautogui.position()) time.sleep(1) 마우스 import pyautogui pyautogui.moveTo(300, 300) # 마우스 이동 (x 좌표=300, y 좌표=300) pyautogui.moveRel(x, y, t) # 마우스 이동 (현재위치에서 좌표만큼 시간을 사용해서 이동) pyautogui.click() # 클릭 pyautogui.doubleClick() # 더블 클릭 pyautogui.click(button='right..
[Java코드]알파벳 오더로 정렬하기 알파벳 오더로 정렬하기 아스키 코드 룰에 따라서 [숫자][대문자][소문자]로 정렬됩니다 0 ~ 9, A ~ Z, a ~ z Time complexity : O( log n) Space complexity : O(1) List Collections.sort(List_values); Array Arrays.sort(String[]array); Time complexity : O(n^2) Space complexity : O(1) public static String[] LexicalOrder(String[] words) { int n = words.length; for (int i = 0; i < n - 1; ++i) { for (int j = i + 1; j < n; ++j) { if (words[i].c..
[java코드]노드 리버스 public static ListNode reverse(ListNode head) { ListNode prev = null; while (head != null) { ListNode next = head.next; head.next = prev; prev = head; head = next; } return prev; } Time complexity : O(n)O(n)O(n) Space complexity : O(1)O(1)O(1) input : head node of LinkedList output : head node of LinkedList

반응형