[Tutor] Help Command Question
Mark Lawrence
breamoreboy at yahoo.co.uk
Tue Jul 28 19:59:50 CEST 2015
On 28/07/2015 18:00, ltc.hotspot at gmail.com wrote:
>
> Hi Everyone,
>
> I'm trying to print a command of list options by using the help command in the iPython interpreter. Read captured copy of the printout as follows:
>
> 'Python 2.7.10 |Anaconda 2.3.0 (64-bit)| (default, May 28 2015, 16:44:52) [MSC v.
> 1500 64 bit (AMD64)]
> Type "copyright", "credits" or "license" for more information.
>
> IPython 3.2.0 -- An enhanced Interactive Python.
> Anaconda is brought to you by Continuum Analytics.
> Please check out: http://continuum.io/thanks and https://anaconda.org
>
> In [1]: help list
> File "<ipython-input-1-823a3ff84bc4>", line 1
> help list
> ^
> SyntaxError: invalid syntax.'
>
>
> Question: What is the correct help command?
>
Standard iPython says this.
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64
bit (AMD64)]
Type "copyright", "credits" or "license" for more information.
IPython 3.2.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: list?
Docstring:
list() -> new empty list
list(iterable) -> new list initialized from iterable's items
Type: type
In [2]: list??
Docstring:
list() -> new empty list
list(iterable) -> new list initialized from iterable's items
Type: type
In [3]: help(list)
Help on class list in module builtins:
class list(object)
| list() -> new empty list
| list(iterable) -> new list initialized from iterable's items
|
| Methods defined here:
|
| __add__(self, value, /)
| Return self+value.
...
Got it?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
More information about the Tutor
mailing list