플그래밍 226

[파이썬 에러] DeprecationWarning: executable_path has been deprecated, please pass in a Service object

0. 에러 DeprecationWarning: executable_path has been deprecated, please pass in a Service object 이번 Selenium 4.0 업데이트로 인해 발생하는 에러입니다. 🔗 Selenium 4.0 Beta 1 changelog 1. 업데이트 및 모듈 추가 pip3 install -U selenium pip3 install webdriver-manager 셀레니움 4.0 이상 버젼으로 설치 webdriver-manager 설치 # BEFORE from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.chrome.op..

[파이썬 기초] pyautogui 설치방법

pyautogui 설치방법 pip install pyautogui pip list pip --version (pip -V) python -m pip install --upgrade pip python -m pip install pip==22.2.2 ImportError: cannot import name 'SourceDistribution' > Visual Studio Code 실행 > 터미널 창 열기 (단축키: ctrl + `) pip install pyautogui > pyautogui library 설치 > Proceed (Y/n)? 확인 문구에서 y 입력 후 설치 진행 pip list > 설치되어있는 library의 목록 조회 pip --version (pip -V) > pip 버젼 조회 pyth..

[파이썬 기초] 너무 쉬운 pyautogui

📝 pyautogui, pyautogui 설치방법, pyautogui 이미지서치, pyautogui란, 파이썬 pyautogui, pyautogui 윈도우키, pyautoguiPAUSE import pyautogui 📋 모듈 불러오기 pyautogui.FAILSAFE = True 📋 FAILSAFE 적용 (좌측상단으로 커서 이동시 실행 종료) pyautogui.PAUSE = 1.0 📋 pyautogui (각각의)콜 이후 대기시간(초) x, y = pyautogui.locateCenterOnScreen('target.png') 📋 화면 상 이미지 파일의(target.png) 센터 x, y 좌표값을 반환 pyautogui.size() 📋 해상도 x, y 값 반환 pyautogui.position() 📋 커서..

[파이썬] 간단하게 조합(Combination) 구하기

파이썬에서 일일히 수동으로 조합을 계산하려다보면 코드도 너무 길어지고 시간도 오래걸리는데요... 이를 간단하게 구할 수 있는 방법에 대해서 알아볼께요. 일단 코드부터... from itertools import combinations import math example = [1, 2, 3, 4, 5, 6, 7, 8, 9] n = len(example) r = 2 print(f'{int(math.factorial(n)/(math.factorial(r)*math.factorial(n-r)))}개\n') print("기존 리스트") print(str(example)) results = list(combinations(example, r)) print(f"\n가능한 모든 조합 ({len(results)}개)")..

[파이썬] 가상환경 Activate 오류

아래 코드를 실행하여 가상환경을 실행시켰을 때, myvenv\Scripts\activate '이 스크립트는 이 시스템에서 실행되지 않습니다.' 오류가 발생 할 경우, Windows PowerShell을 관리자 권한으로 실행하여, Set-ExecutionPolicy -ExecutionPolicy RemoteSigned 권한을 변경해주고 다시 가상환경을 실행하면 됩니다. myvenv\Scripts\activate 위의 명령어로 myvenv 상위 폴더에서 가상환경 실행

[파이썬] datetime 모듈 기초

파이썬에서 날짜와 시간을 처리하는 것은 여간 번거로운 일이 아닐 수 없는데요. 고맙게도, 파이썬 datetime 모듈을 사용하면 좀 더 간편하게 해당 문제를 해결할 수 있습니다. 직접 코딩을 시작하기전에 datetime 모듈에서 사용되는 5가지 주요 객체 클래스는 다음과 같습니다. datetime 시간과 날짜(월, 일, 연도, 시간, 초, 마이크로초) date 날짜 (월, 일, 년) time 시간 (시간, 분, 초, 마이크로초) time delta 소요 시간 tzinfo 시간대 일단 위의 5가지 객체 클래스가 있다는 사실만 숙지하고 넘어가보도록 할께요. 다음 코드를 통해 현재 시간을 추출할 수 있고 해당 객채는 datetime 클래스를 갖게 됩니다. # 모듈 임포트 from datetime import ..

728x90