이 시리즈는 내가 파이썬으로 코딩을 할때 사용한 모듈을 나만의 방식으로 정리해 놓는 공간이다.
소개 Beautiful Soup is a Python library for pulling data out of HTML and XML files. It works with your favorite parser to provide idiomatic ways of navigating, searching, and modifying the parse tree. It commonly saves programmers hours or days of work. These instructions illustrate all major features of …
이 시리즈는 내가 파이썬으로 코딩을 할때 사용한 모듈을 나만의 방식으로 정리해 놓는 공간이다. 나는 이런 경험이 있다. 인터넷을 보고 비슷하게, 따라서 코딩을 했지만 해당 모듈이 어떻게 동작하는지 함수에서는 어떤 매개변수를 쓰는지 궁금했다. 그래서 Document를 찾아봤지만, 자세히 안보고 넘기게 되더라. 보통 영어이고, 문서가 엄청 길기 때문에.. 그래서 그냥 작정하고 달려들기로 했다. …
간단한 Requests 예시 r = requests.get('https://api.github.com/user', auth=('user', 'pass')) print(r.status_code) print(r.headers['content-type']) print(r.encoding) print(r.text) print(r.json()) # 403 # application/json; charset=utf-8 # utf-8 # {"message":"Maximum number of login attempts exceeded. Please try again later.","documentation_url":"https://developer.github.com/v3"} # {'message': 'Maximum number of login attempts exceeded. Please try again later.', 'documentation_url': 'https://developer.github.com/v3'} r.status_code 는 .get 부분에 auth=에 …
아래 링크들이 다 잘되어 있어서 일단 링크로 대체한다. Telegram Bot API 튜토리얼 API는 Telegram Bot API를 참고하면 된다. https://python-telegram-bot.readthedocs.io/en/stable/ 참고문헌
OS 모듈은 파이썬을 설치할 때 자동으로 설치되는 파이썬 라이브러리에 포함된다. 그리고 환경 변수나 디렉토리, 파일 등의 OS 자원을 제어할 수 있게 해주는 모듈입니다. 현재 작업 폴더 얻기 os.getcwd()를 사용하여 얻습니다. (get current working directory) print(os.getcwd()) # D:\source\test 디렉토리 변경 os.chdir(path)를 사용합니다. (path는 문자열이어야함.) os.chdir("C:\WINDOWS") print(os.getcwd()) # C:\WINDOWS 시스템 명령어 호출하기 …