ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 12 Feb 2012 11:44:01 +0100Getting help inside Sagehttps://ask.sagemath.org/question/8708/getting-help-inside-sage/Sorry if it's a dumb question, folks.
What are all the ways of getting help inside Sage? I would like some table like this:
item?? | see code
help(item) | see help about item
I ask this question because I only know the ?? and help() ways. But they don't always work: I tried simplify_full?? and help(simplify_full) but ... got errors!
Sat, 11 Feb 2012 13:38:50 +0100https://ask.sagemath.org/question/8708/getting-help-inside-sage/Answer by DSM for <p>Sorry if it's a dumb question, folks.</p>
<p>What are all the ways of getting help inside Sage? I would like some table like this:</p>
<pre><code>item?? | see code
help(item) | see help about item
</code></pre>
<p>I ask this question because I only know the ?? and help() ways. But they don't always work: I tried simplify_full?? and help(simplify_full) but ... got errors!</p>
https://ask.sagemath.org/question/8708/getting-help-inside-sage/?answer=13266#post-id-13266No, you've basically got it. To look at the docs for some object:
help(some_function)
some_function?
some_function?? # also shows the source code
The reason that `help(simplify_full)` didn't work was that it isn't an object which is in scope; it's a *method*, and methods are functions which live inside objects. As you have to type some_object.method() to call them, you need to type
help(Expression.simplify_full)
Expression.simplify_full?
Expression.simplify_full??
where Expression is the class, or if you have an object instance around like x, you could use that:
sage: type(x)
<type 'sage.symbolic.expression.Expression'>
sage: help(x.simplify_full) # or x.simplify_full?, or x.simplify_full??
Does that make sense? The help/?/?? things need access to an object, and it needs to be pretty direct.
[Technical note: help(sin(x)) will give you the help for the Expression class, because sin(x) is evaluated, it's an Expression instance, and so help() shows the docs for that. sin(x)? won't work, because the "?" tries to look to see whether the object before it exists, and there is no object called "sin(x)".]
Sat, 11 Feb 2012 14:26:55 +0100https://ask.sagemath.org/question/8708/getting-help-inside-sage/?answer=13266#post-id-13266Comment by Green diod for <p>No, you've basically got it. To look at the docs for some object:</p>
<pre><code>help(some_function)
some_function?
some_function?? # also shows the source code
</code></pre>
<p>The reason that <code>help(simplify_full)</code> didn't work was that it isn't an object which is in scope; it's a <em>method</em>, and methods are functions which live inside objects. As you have to type some_object.method() to call them, you need to type</p>
<pre><code>help(Expression.simplify_full)
Expression.simplify_full?
Expression.simplify_full??
</code></pre>
<p>where Expression is the class, or if you have an object instance around like x, you could use that:</p>
<pre><code>sage: type(x)
<type 'sage.symbolic.expression.Expression'>
sage: help(x.simplify_full) # or x.simplify_full?, or x.simplify_full??
</code></pre>
<p>Does that make sense? The help/?/?? things need access to an object, and it needs to be pretty direct.</p>
<p>[Technical note: help(sin(x)) will give you the help for the Expression class, because sin(x) is evaluated, it's an Expression instance, and so help() shows the docs for that. sin(x)? won't work, because the "?" tries to look to see whether the object before it exists, and there is no object called "sin(x)".]</p>
https://ask.sagemath.org/question/8708/getting-help-inside-sage/?comment=20305#post-id-20305Thanks!! I knew it was a method but I didn't know how to access to its help.Sun, 12 Feb 2012 11:44:01 +0100https://ask.sagemath.org/question/8708/getting-help-inside-sage/?comment=20305#post-id-20305