How to tailor output of help()

K

Kyle

Hi all,
I'm a graduate student in the physical sciences and still new to
Python. I'm writing a module of often-used code and have included
several math functions in my module via

from math import cos

and similarly for other functions. When I input help(mymodule) into
the console, cos() and its docstring are listed in the output section
for my module's functions. However, I only want functions that I have
written to appear, not those that I imported. I know this is merely
aesthetic, but is there a way to eliminate functions that I imported
from the function list in the output from help()? Thanks,

-kmd
 
S

Steve Holden

Kyle said:
Hi all,
I'm a graduate student in the physical sciences and still new to
Python. I'm writing a module of often-used code and have included
several math functions in my module via

from math import cos

and similarly for other functions. When I input help(mymodule) into
the console, cos() and its docstring are listed in the output section
for my module's functions. However, I only want functions that I have
written to appear, not those that I imported. I know this is merely
aesthetic, but is there a way to eliminate functions that I imported
from the function list in the output from help()? Thanks,
Try setting the __all__ variable in your module to a list of the names
you want your module to export.

regards
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top