search

Home  >  Q&A  >  body text

After writing the python module, how to write the documentation?

I am a newbie and have never released a python program before.
Recently, the teacher asked me to write two small python modules, one is to convert pdf to txt, and the other is to calculate the similarity of the converted txt document. I have written it and know how to package it into a third-party library, but I don’t know how to write the supporting documentation?
I also checked on the Internet, and some people said that the content in the comment is the document (I wrote this comment carefully), but I don’t know if I need to put a txt file in the package and write How about writing down the usage of different functions in different modules?
Thank you everyone, I really don’t know how to do this document...

黄舟黄舟2783 days ago655

reply all(3)I'll reply

  • PHP中文网

    PHP中文网2017-05-24 11:37:07

    sphinx

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-24 11:37:07

    I guess you have also used git, which is similar to the readme file in git project. Look at how the two open source projects are written. The purpose of writing the readme is probably to help others know what the project is, what it can do, and how to use it. Please pay attention. Main points, almost enough sauce

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-24 11:37:07

    Example:

    模块.py

    '''
    这是模块文档
    '''
    pass
    >>> import 模块
    >>> help(模块)
    Help on module 模块:
    
    NAME
        模块 - 这是模块文档
    
    FILE
        d:\python34\模块.py
    
    
    >>> 

    reply
    0
  • Cancelreply