Python tutorial- get help


Get help


To get help from Python, you need to use help() method and type what to want to get help. For example, you might need help on using ceil() method of math library.
>>> help()
Welcome to Python 2.5!  This is the online help utility. If this is your first time using Python, you should definitely check out the tutorial on the Internet at http://www.python.org/doc/tut/.
Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".
 
To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics".  Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam".
 
help> math.ceil
Help on built-in function ceil in math:
 
math.ceil = ceil(...)
    ceil(x)
   
    Return the ceiling of x as a float.
    This is the smallest integral value >= x.
 
help>
 
Or you can supply what you want to get help as a parameter of help() method.
 
>>>import math #import math module
>>> help(math.ceil)
Help on built-in function ceil in module math:
 
ceil(...)
    ceil(x)
   
    Return the ceiling of x as a float.
    This is the smallest integral value >= x.
 
>>> 
 
Note:
-ceil() method is a method of math module. You need to import math module before you can use the method. -# sign is used to make a comment in Python code.


Comments




This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.