PYTHON
-
HTML의 코드 구조와 요소 (Element), Selenium 기본 문법PYTHON/Python 업무 자동화 2024. 1. 6. 21:54
* https://www.yes24.com/Product/Goods/118396923 이 책을 보고 공부하였습니다. IT 비전공자를 위한 파이썬 업무 자동화 (RPA) - 예스24 해도 해도 끝나지 않는 반복 업무... 어떻게 해결할 수 있을까요?상사의 지시, 고객사 대응, 메일 처리, 일정 문의, 정산 작업... 해도 해도 줄기는커녕 늘어나는 반복 업무. 매크로와 단축키 신공 www.yes24.com # div 태그 가져오기 a = driver.find_element(By.TAG_NAME, 'div'> a.get_attribute('innerHTML') div를 모두 가져오는게 아닌, div 코드 중 맨 처음 나온 div 코드를 가져옴. -> 최상위 div 코드를 가져옴 a = driver.find_e..
-
비동기 라이브러리 AsyncioPYTHON/Python 라이브러리 2024. 1. 5. 19:46
동기 (Synchronous)와 비동기(Asynchronous) 싱크러너스 / 에이싱크러너스 동기 : 서버에 요청을 보냈을 때 응답이 돌아와야 다음 동작 수행 가능 즉, A작업이 모두 진행될 때까지 B작업은 대기해야 함 비동기 : 서버에 요청을 보냈을 때 응답 상태와 상관없이 다음 동작 수행 가능 A작업이 시작되면 동시에 B작업도 실행. A작업은 결과값이 나오는대로 출력 Asyncio 에이싱크아이오 대규모 병행 작업을 위한 비동기 프로그래밍 동시성 코드를 작성하는 라이브러리 ! 단일 프로그램에서 동시에 여러개의 HTTP 요청 병행하여 실행 가능 대기를 필욜 하는 여러개의 작업 동시 수행 가능 작업 A가 완료되길 기다리는 동안 작업 B 수행 가능 Python에서는 Asyncio 모듈을 통해 '코루틴' 지원..
-
파이썬 문법 관련 10문제를 풀어보자 !PYTHON/Python 문법 2024. 1. 4. 17:50
1. 두 정수를 입력 받아 더한 결과 출력 값이 3이 나와야 하는데 1과 2를 붙인 12가 나온다 왤까? input에서 입력받은 값은 항상 문자열 형태이기 때문 따라서 input에서 받은 문자열을 정수로 변환해줘야 함 1번 답 : # 두 정수를 입력 받아서 더한 결과를 출력하는 파이썬 프로그램을 작성하세요. def sub(): a = int(input('정수를 입력하세요: ')) b = int(input('정수를 입력하세요: ')) print(a+b) sub() 2. 리스트에서 짝수만 출력하기 2번 답 : # 리스트에서 짝수만 출력 def list(): a = [1,2,3,4,5,6,7,8,9,10] for i in a: if i % 2 == 0: print(i) list() 3. 문자열 "Hello, ..
-
#1 텍스트데이터를 엑셀, 워드클라우드로 만들기PYTHON/Python 업무 자동화 2024. 1. 2. 21:30
* https://www.yes24.com/Product/Goods/118396923 이 책을 보고 공부하였습니다. IT 비전공자를 위한 파이썬 업무 자동화 (RPA) - 예스24 해도 해도 끝나지 않는 반복 업무... 어떻게 해결할 수 있을까요?상사의 지시, 고객사 대응, 메일 처리, 일정 문의, 정산 작업... 해도 해도 줄기는커녕 늘어나는 반복 업무. 매크로와 단축키 신공 www.yes24.com 주피터 노트북 코드 실행 후 셀 생성 : alt + enter 주피터 코드 실행 : shift + enter 주피터 노트북은 하나의 라인을 셀이라고 함 ( 코드 셀 / 마크다운 셀 ) 코드 셀 : 코드 구현 마크다운 셀 : 문서 제작할 때 사용 1. 인터넷에 있는 특정 단어와 관련된 기사의 제목 가져오기 ..
-
Tkinter 사용법PYTHON/Python 라이브러리 2024. 1. 2. 17:53
* https://076923.github.io/posts/Python-tkinter-1/ 를 참조하여 공부했습니다. import tkinter window=tkinter.Tk() # 가장 상위 레벨의 윈도우 창 생성 window.title("Tkinter 공부") # 윈도우 창의 제목 window.geometry("300x300+100+100") # 너비x높이+x좌표+y좌표 (초기 화면 위치의 좌표까지 설정 가능) # 영문자 x를 사용해야 함 window.resizable(False, False) # 윈도우 창 크기 조절 가능 여부 # True로 설정시 윈도우 창 크기 조절 가능 label=tkinter.Label(window, text="로그인") # 라벨 위젯 설정 label.pack() # 위젯 ..
-
자료형PYTHON/Python 문법 2023. 12. 30. 02:20
* 점프 투 파이썬(https://wikidocs.net/book/1)를 보며 공부한 내용을 복습했습니다. 숫자형 제곱 연산자 ** 나머지 연산자 % 몫 연산자 // 나눗셈 연산자 / 문자열(String) 자료형 여러줄 문자열 자주 쓰는 이스케이프 코드(문자 조합, 출력물을 보기 좋게 정렬하는 용도) \n 문자열 안에서 줄을 바꿀 때 사용 \t 문자열 사이에 탭 간격을 줄 때 사용 \\ \를 그대로 표현할 때 사용 \' 작은따옴표(')를 그대로 표현할 때 사용 \" 큰따옴표(")를 그대로 표현할 때 사용 문자열 더하기 , 곱하기 문자열 길이, 인덱싱(indexing, 가르키다), 슬라이싱(slicing, 잘라내다) 파이썬 f-string 포매팅 참고 블로그 https://blockdmask.tistory..
-
파이썬이란?PYTHON/Python 문법 2023. 12. 30. 02:19
* 점프 투 파이썬(https://wikidocs.net/book/1)을 보며 공부한 내용을 복습했습니다. 파이썬이란?암스테르담의 귀도 반 로섬이 개발한 인터프리터 언어. 파이썬은 고대 신화에 나오는 파르나소스 산의 동굴에 살던 큰 뱀을 뜻하며, 아폴로신이 델파이에서 파이썬을 퇴치했다는 이야기가 전해지므로 대부분의 파이썬의 표지는 뱀 모양 ! 구글에서 만든 소프트웨어의 50%이상이 파이썬으로 제작됨. 인스타그램, 넷플릭스, 아마존등 많은 IT기업에서 사용 인터프리터(interpreter)란?고수준 프로그래밍 언어로 작성된 프로그램을 직접 실행하는 프로그램 또는 환경.컴파일러(compiler)와 달리, 인터프리터는 프로그램을 별도의 기계어 코드로 변환하여 저장하지 않고, 소스 코드를 한 줄씩 해석한 후, ..