1 개요[ | ]
- Python help
- 파이썬 help
- 도움말을 보여주는 명령어
2 실행예시 1: 기본 함수/클래스[ | ]
Python
Copy
>>> help(print)
Help on built-in function print in module builtins:
print(...)
print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)
Prints the values to a stream, or to sys.stdout by default.
... (생략)
Python
Copy
>>> import math
>>> help(math)
Help on built-in module math:
NAME
math
... (생략)
Python
Copy
>>> help(math.pow)
Help on built-in function pow in module math:
pow(...)
pow(x, y)
Return x**y (x to the power of y).
3 실행예시 2: 사용자 함수/클래스[ | ]
Python
Copy
def greet():
print('hello')
help(greet)
'''
Help on function greet in module __main__:
greet()
'''
Python
Copy
class ClassName(object):
"""ClassName에 대한 정보"""
def __init__(self, arg):
super(ClassName, self).__init__()
self.arg = arg
help(ClassName)
'''
Help on class ClassName in module __main__:
class ClassName(builtins.object)
| ClassName에 대한 정보
|
| Methods defined here:
|
| __init__(self, arg)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
'''
4 같이 보기[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.
- 분류 댓글:
- Python (25)
리눅스 Python 2.7 컴파일 설치 ― …리눅스 Python 2.7 컴파일 설치 ― …리눅스 Python 2.7 컴파일 설치 ― …리눅스 Python 2.7 컴파일 설치 ― …리눅스 Python 2.7 컴파일 설치 ― Jmnote리눅스 Python 2.7 컴파일 설치 ― ㅇㅇㅇ미운코딩새끼 ― 승호 도령미운코딩새끼 ― 불탄고등어미운코딩새끼 ― 김레이미운코딩새끼 ― 호박이미운코딩새끼 ― Junhg0211미운코딩새끼 ― 김왼손미운코딩새끼 ― 용딘이미운코딩새끼 ―Pinkcrimson
유기농냠냠파이썬 ― 호박유기농냠냠파이썬 ― 이에스유기농냠냠파이썬 ― 이승현파이썬 global ― Jmnote파이썬 global ― John Jeong파이썬 global ― Jmnote파이썬 global ― John Jeong파이썬 global ― John Jeong파이썬 global ― John Jeong파이썬 global ― Jmnote파이썬 global ― John Jeong