Luv{Flag}
article thumbnail
파이썬 requests 모듈 사용법 정리 (Python requests)
Web/Python 2023. 5. 17. 20:20

. PIP(파이썬 패키지 매니저)를 이용해 설치하고 $pip install requests requests 모듈을 import 하여 사용한다. import requests GET,POST 뿐만 아니라, HTTP Request 옵션 PUT, OPTIONS, HEAD, DELETE 들을 아주 간편하게 지원합니다. r = requests.get('https://exam.com') r = requests.put('https://exam.com', data={'key': 'value'}) r = requests.delete('https://exam.com/delete') r = requests.head('https://exam.com/get') r = requests.options('https://exam.com..

article thumbnail
파이썬 문자열 완전탐색 코드 (Python brute force)
Web/Python 2022. 11. 15. 14:00

from itertools import product import string strings = string.ascii_letters + string.digits for length in range(1, 5):# length 1 to 4 to_attempt = product(strings, repeat=length) for attempt in to_attempt: bruteforce = ''.join(attempt) print(bruteforce) 적절히 커스텀하여 파이썬으로 문자열 brute force를 할 경우 사용하자.

article thumbnail
파이썬 오류정리 (Python Error)
Web/Python 2022. 11. 15. 09:30

Python - TabError TabError: inconsistent use of tabs and spaces in indentation 파이썬에서는 C와 같은 언어와 다르게 들여쓰기에 매우 민감하다. 위와 같은 오류는 들여쓰기를 잘못 하여 발생하는 오류로, 들여쓰기가 잘 되어있는지 확인한다. 육안상으로는 문제가 없어 보일지라도 SPACE와 TAB을 구분하기 때문에 둘 중 하나로 통일 시켜야 한다. 코드를 복사해와 커스텀할때 주의하자 Python - IndexError IndexError: list index out of range 필자는 주로 반복문을 사용하여 list의 값에 접근할때 이러한 에러를 만난다. 혹은 list의 index가 0부터 시작한다는 것을 생각 하지 못했을때 이런 오류를 만날 것..

검색 태그

loading