반응형 분류 전체보기14 Python - win32gui를 이용한 color얻은 후 rgb로 변환 Code 1 2 3 4 5 6 7 8 9 10 11 import win32gui def convert_rgb(value): B = value & 255 G = (value >> 8) & 255 R = (value >> 16) & 255 return (R, G, B) pos_color = win32gui.GetPixel(win32gui.GetDC(win32gui.GetActiveWindow()), 200, 200) print(hex(pos_color)) print(convert_rgb(pos_color)) Colored by Color Scripter cs 0x262525 (38, 37, 37) 2022. 12. 29. Python - win32api and win32con을 이용한 정보 얻기 Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 import win32api import win32con print("------Get System Info-------------------------") print(win32api.GetComputerName()) print(win32api.GetUserName()) print(win32api.GetLocalTime()) print(win32api.GetSystemTime()) print("\n-----Get Display Info-----------------------") print('Width:', win32api.GetSystemMetrics(0)) print('Height.. 2022. 12. 29. python - selenium을 이용한 파일 다운로드 Code (One Click) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 from selenium import webdriver from selenium.webdriver.common.by import By get_path ='https://chromedriver.storage.googleapis.com/index.html?path=109.0.5414.25/' download_path = "D:\\" def chromedriver_start(ge.. 2022. 12. 29. python - Time 변환 1. 현재 날짜와 시간을 구하고 strftime을 이용해 특정 format으로 변환 후 출력 Code 1 2 3 4 5 6 7 8 9 10 import time now_YYYYmmdd = time.strftime('%Y%m%d') print(f"now_YYYYmmdd: {now_YYYYmmdd}") now_yymmdd = time.strftime('%y%m%d') print(f"now_yymmdd: {now_yymmdd}") now_HHMMSS = time.strftime('%H%M%S') print(f"now_HHMMSS: {now_HHMMSS}") cs Result now_YYYYmmdd: 20221229 now_yymmdd: 221229 now_HHMMSS: 110224 2022. 12. 29. 이전 1 2 다음 반응형