본문 바로가기

전체 글66

Python requests 모듈 HTTP 요청 처리를 하기 위해 쓰는 모듈. 기본 내장 모듈이 아니라 따로 설치 해주어야 한다. 설치 하지 않으면, ModuleNotFoundError: No module named 'requests' 이런 에러가 발생함 커맨드 창에서 pip install requests 명령어 입력하여 설치. 2020. 1. 25.
Python 컬렉션 타입 List & Tupple List와 Tupple은 거의 동일. List - mutable ( 생성 후에도 변경 가능 ) Tupple - immutable ( 생성 후에는 변경 불가 ) a = [ 1, 2, 3, 4 ] #List #[1, 2, 3, 4] a = 'hello world' b = list(a) #['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'] c = (1, 2, 3) #Tupple d = list(c) #[1, 2, 3] 다른 타입으로 부터 list 생성도 가능하다. str 과 list a = 'hello world' #a[0] = 'j' #TypeError: 'str' object does not support item assignment.. 2020. 1. 25.
Python 조건문, 반복문 조건문 if / elif / else 정수, 실수, 문자열 리스트 등 기본 타입도 조건에 사용 가능 False로 간주되는 값 (각 타입의 기본값) None 0 0.0 '' [] -> 빈 리스트 () -> 빈 튜플 {} -> 빈 딕셔너리 set() -> 빈 집합 a = [1, 2] if a: print(a) else: print('내용이 없습니다.') #[1, 2] 반복문 while 조건문: break //반복문 중단 continue //반복문 처음으로 돌아가기 for 변수 in 리스트( 튜플, 문자열 ): range(start, stop, step) 해당되는 범위 만큼 반복 객체를 만든다. a = range(1, 10, 3) #[1, 4, 7] for i in a: print(i) # 1 4 7 문자열 .. 2020. 1. 23.
Front-end Framework 사이트 Bootstrap 외에 참고해볼만한 사이트들 Foundation ( bootstrap과 유사) The most advanced responsive front-end framework in the world. | Foundation Responsive design gets a whole lot faster A Framework for any device, medium, and accessibility. Foundation is a family of responsive front-end frameworks that make it easy to design beautiful responsive websites, apps and emails that look amazing on any d foundation.z.. 2020. 1. 23.