새싹교실/2017/의사양반/2017.05.15 (rev. 1.7)
가상환경 ¶
- virtaulenv - pycharm에서 해보자
- pip
- get-pip.py
- show
- list
- freeze
- install/uninstall
클래스 ¶
- class 클래스명:
- 클래스 첫글자는 대문자 = class Service, class Person
- self
- init
모듈 ¶
- import 모듈이름
- from 모듈이름 import 모듈함수
- main
예외처리 ¶
try:
except:
pass
except 발생오류 as 오류 메시지 변수:
else:
finally:
def error(self):
raise NotImplementedError
내장함수 ¶
- isinstance
- id
- input/print
- lambda
- len
- list
- str
- type
과제 ¶
사용자에게 문자열을 입력받으면 해당 내용을 파일로 저장하고 파일을 불러와 화면에 출력하는 프로그램 만들기
실행 예시
save "아 배고프다...."
-> 현재시간.txt 파일 생성
load 0115.txt
-> 0115.txt 파일을 열어서 파일 내용을 출력