일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- X11
- tibero
- golang
- Tuple
- oracle
- python3.7
- DDL 추출
- OPEN CURSOR
- tac
- terraform
- VM 설정
- 프로그래머스
- 코딩테스트
- VMware
- Python
- vm
- implicit
- 암시적 커서
- X11 forwarding
- CentOS
- tablespace
- 티베로
- 묵시적 커서
- db
- vm tac 구성
- 파이썬
- 리눅스
- 코테
- tas tac
- Linux
Archives
- Today
- Total
줄기세포
[Python 기초 / 파이썬 마스터] 자료형, 모듈 등에서 사용 가능한 함수 확인 방법 본문
◆ 파이썬 마스터 (2023.06.14) 기준 - Python3.7 버전
자료형, 모듈 등에서 사용가능한 함수 확인 방
- dir() 함수를 사용한다
# 자료형 예약어로 확인가능
>>> dir(list)
['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
'__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__',
'__getitem__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__',
'__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mul__',
'__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__',
'__rmul__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__',
'append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop',
'remove', 'reverse', 'sort']
# 특정 모듈이나 자료를 부여한 변수로 사용가능
>>> a = [1,2,3]
>>> dir(a)
['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
'__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__',
'__getitem__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__',
'__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mul__',
'__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__',
'__rmul__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__',
'append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop',
'remove', 'reverse', 'sort']
# dir을 dir해봄
>>> dir(dir)
['__call__', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__',
'__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__',
'__init_subclass__', '__le__', '__lt__', '__module__', '__name__', '__ne__',
'__new__', '__qualname__', '__reduce__', '__reduce_ex__', '__repr__', '__self__',
'__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__text_signature__']
'Python' 카테고리의 다른 글
[Python 기초 / 파이썬 마스터] 문자열 원하는 자리수 맞추기. 좌우 가운데 정렬하기 (center, just) (0) | 2023.06.16 |
---|---|
[Python 기초 / 파이썬 마스터] 문자열 양 끝 공백 제거 메소드 (strip) (0) | 2023.06.15 |
[Python3.7] 자동설치 shell script / CentOS 7.9 (0) | 2023.05.21 |
[Python] 피라미드 별(*) 프린트 코드 (0) | 2023.05.21 |
[Python] 리눅스에서 json을 pipeline으로 받아 key 값 출력 (0) | 2023.01.16 |