Re: [Tutor] Basic question about docstrings

2015-07-30 Thread Danny Yoo
> > So main.py contains: > > def get_field(value, start_bit, end_bit): > > > and I see: > > >>> import main > >>> help(get_field) > Traceback (most recent call last): >File "", line 1, in > NameError: name 'get_field' is not defined > > > help(main) works ok but is rather verbose. Try:

Re: [Tutor] Basic question about docstrings

2015-07-30 Thread David Aldrich
If I have a script called main.py and document a function in it: def get_value(x): """ Some text ... :param x: Some value :returns: Something useful """ What is the most basic way of showing those docstrings at the

Re: [Tutor] Basic question about docstrings

2015-07-30 Thread Steven D'Aprano
On Thu, Jul 30, 2015 at 04:28:33PM +, David Aldrich wrote: > So main.py contains: > > def get_field(value, start_bit, end_bit): > > > and I see: > > >>> import main > >>> help(get_field) > Traceback (most recent call last): >File "", line 1, in > NameError: name 'get_field' is n

Re: [Tutor] Basic question about docstrings

2015-07-30 Thread Steven D'Aprano
On Thu, Jul 30, 2015 at 08:24:27AM +, David Aldrich wrote: > I understand that 'help' works with modules that I have imported. But > if I've just written a script called main.py (which contains > get_value()) I don't think I can 'import' that. So how would I see the > docstrings in main.py?

Re: [Tutor] Basic question about docstrings

2015-07-30 Thread Joel Goldstick
On Thu, Jul 30, 2015 at 4:24 AM, David Aldrich wrote: >>> If I have a script called main.py and document a function in it: >>> >>> def get_value(x): >>> """ >>> Some text ... >>> :param x: Some value >>> :returns: Something useful >>> """ >>> >>> What is the most basic

Re: [Tutor] Basic question about docstrings

2015-07-30 Thread David Aldrich
>> If I have a script called main.py and document a function in it: >> >> def get_value(x): >> """ >> Some text ... >> :param x: Some value >> :returns: Something useful >> """ >> >> What is the most basic way of showing those docstrings at the Python >> prompt? > > Tr

Re: [Tutor] Basic question about docstrings

2015-07-29 Thread Danny Yoo
On Jul 29, 2015 12:45 PM, "David Aldrich" wrote: > > Hi > > If I have a script called main.py and document a function in it: > > def get_value(x): > """ > Some text ... > :param x: Some value > :returns: Something useful > """ > > What is the most basic way of showing

Re: [Tutor] Basic question about docstrings

2015-07-29 Thread Emile van Sebille
On 7/29/2015 8:45 AM, David Aldrich wrote: Hi If I have a script called main.py and document a function in it: def get_value(x): """ Some text ... :param x: Some value :returns: Something useful """ What is the most basic way of showing those docstrings at the

[Tutor] Basic question about docstrings

2015-07-29 Thread David Aldrich
Hi If I have a script called main.py and document a function in it: def get_value(x): """ Some text ... :param x: Some value :returns: Something useful """ What is the most basic way of showing those docstrings at the Python prompt? For getting started with document