# 자주 쓸 것 같은 Python Standard libraries 메모
# Python Standard library: https://docs.python.org/3/library/
# 강의에서 추천
csv: very convenient for reading and writing csv filescollections: useful extensions of the usual data types includingOrderedDict,defaultdictandnamedtuplerandom: generates pseudo-random numbers, shuffles sequences randomly and chooses random itemsstring: more functions on strings. This module also contains useful collections of letters likestring.digits(a string containing all characters with are valid digits).re: pattern-matching in strings via regular expressionsmath: some standard mathematical functionsos: interacting with operating systemsos.path: submodule ofosfor manipulating path namessys: work directly with the Python interpreterjson: good for reading and writing json files (good for web work)
# 상황별
1. 날짜와 시간 관련: datetime
- https://docs.python.org/3/library/datetime.html
2. 현재의 working directory 바꾸기: os
os.chdir(path)
- https://docs.python.org/3/library/os.html
3. csv파일 읽기: csv
- https://docs.python.org/3/library/csv.html
4. zip 파일 압축해제: zipfile
- https://docs.python.org/3/library/zipfile.html
5. 실행시간 측정: cProfile
- https://docs.python.org/3/library/profile.html
- 작은 수행일때는 timeit도 많이 쓴다.
https://docs.python.org/3/library/timeit.html
Reference:
- https://classroom.udacity.com/courses/ud1110
- https://docs.python.org/3/library/
'Program Languages > Python' 카테고리의 다른 글
| 자주 쓸 것 같은 Third-party packages 메모 (1) | 2017.11.03 |
|---|---|
| virtualenv에 OpenAI gym 설치하기(MAC OS) (0) | 2017.10.23 |
| Python 언어 Syntax 요약(feat. Java) (0) | 2017.10.17 |
| virtualenv에 matplotlib 설치하기(MAC OS) (1) | 2017.06.20 |
| virtualenv 독립환경 Pycharm과 연결시키기 (0) | 2017.06.13 |