파이썬 help

  다른 뜻에 대해서는 윈도우 help 문서를 참조하십시오.
  다른 뜻에 대해서는 리눅스 help 문서를 참조하십시오.

1 개요[ | ]

Python help
파이썬 help
  • 도움말을 보여주는 명령어

2 실행예시 1: 기본 함수/클래스[ | ]

>>> 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.
... (생략)
>>> import math
>>> help(math)
Help on built-in module math:

NAME
    math
... (생략)
>>> 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: 사용자 함수/클래스[ | ]

def greet():
	print('hello')
help(greet)
'''
Help on function greet in module __main__:
greet()
'''
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 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}