[Tutor] Closing triple quotation marks.
Lisi
lisi.reisz at gmail.com
Sun Jun 19 09:46:02 CEST 2011
On Sunday 19 June 2011 08:39:43 Alan Gauld wrote:
> "Lisi" <lisi.reisz at gmail.com> wrote
>
> > It does indeed. Thank you, both of you. I have clearly not got the
> > terms
> > command, method, function (and feature?) clearly sorted out in my
> > mind, so
> > that is obviously where I need to go. I am supposed to be
> > researching
> > import, but I have not yet succeeded in seeing why it is a problem.
> > So I'll
> > switch to looking up method, function etc.
>
> Add "callable" to your list of search terms.
> Python has the concept of "callable objects" and
> you can call a callable by using parentheses.
> You can also test whether an object is callable
> or not:
>
> for obj in list_of_objects:
> if callable(obj):
> print obj() # call obj first
> else:
> print obj # just use the obj value
>
> HTH,
Thank you!
Lisi
More information about the Tutor
mailing list