Re: Extract doc strings

2010-07-01 Thread moerchendiser2k3
Great! Thanks a lot! This is what I was looking for. :) Bye, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: Extract doc strings

2010-07-01 Thread Steven D'Aprano
On Thu, 01 Jul 2010 11:55:05 +0200, Thomas Jollans wrote: > On 07/01/2010 11:12 AM, moerchendiser2k3 wrote: >> Hi all, >> >> when I have a PyCodeObject, is there any way to extract a doc string >> from the code? >> For instance the following script > > Code objects don't have doc strings, as suc

Re: Extract doc strings

2010-07-01 Thread Ben Finney
moerchendiser2k3 writes: > thanks for your answer. Sure, __doc__ is the access point to the > docstring, but in this case, I just get the docstring of the code > object. So an explanation what a code object, but I need the docstring > of real docstring of the script. I'm probably not understandi

Re: Extract doc strings

2010-07-01 Thread Thomas Jollans
On 07/01/2010 11:12 AM, moerchendiser2k3 wrote: > Hi all, > > when I have a PyCodeObject, is there any way to extract a doc string > from the code? > For instance the following script Code objects don't have doc strings, as such. However, for functions at least (this may or may not be true for co

Re: Extract doc strings

2010-07-01 Thread Jean-Michel Pichavant
moerchendiser2k3 wrote: Hi all, when I have a PyCodeObject, is there any way to extract a doc string from the code? For instance the following script <---script> """ Hello World! """ def main(): pass main() I would like to get "Hello World!". Any chance? Thanks in advance!! Bye, moer

Re: Extract doc strings

2010-07-01 Thread moerchendiser2k3
Hi ben, thanks for your answer. Sure, __doc__ is the access point to the docstring, but in this case, I just get the docstring of the code object. So an explanation what a code object, but I need the docstring of real docstring of the script. bye, moerchendiser -- http://mail.python.org/mailman/

Re: Extract doc strings

2010-07-01 Thread Ben Finney
moerchendiser2k3 writes: > when I have a PyCodeObject, is there any way to extract a doc string > from the code? I'm not very familiar with using the C interface for Python, but does it help to know that a docstring for an object is available at that object's ‘__doc__’ attribute? -- \

Extract doc strings

2010-07-01 Thread moerchendiser2k3
Hi all, when I have a PyCodeObject, is there any way to extract a doc string from the code? For instance the following script <---script> """ Hello World! """ def main(): pass main() I would like to get "Hello World!". Any chance? Thanks in advance!! Bye, moerchendiser2k3 -- http://ma