Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pyutils module
#13
You can see an example of my doc style here:
https://github.com/Mekire/pygame-samples..._change.py

Docstrings will actually show up when you run help on something so adopting the convention of using them actually does have some merit. 

For example with the above file:
>>> import color_change
>>>
>>> help(color_change)
Help on module color_change:

NAME
    color_change

FILE
    c:\users\sean\desktop\programming\pythonstuff\pygame-samples\color_change.py

DESCRIPTION
    This example serves as a basics introduction.
    Change the screen color with a mouse click.

    This program is intentionally over-commented to serve as an introduction for
    those with no knowledge of pygame. More advanced examples will not adhere to
    this convention.

    -Written by Sean J. McKiernan 'Mekire'

CLASSES
    __builtin__.object
        App

    class App(__builtin__.object)
     |  This is the main class for our application.
     |  It manages our event and game loops.
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Get a reference to the screen (created in main); define necessary
     |      attributes; and set our starting color to black.
     |
     |  event_loop(self)
     |      Our event loop; called once every frame.  Only things relevant to
     |      processing specific events should be here.  It should not
     |      contain any drawing/rendering code.
     |
     |  main_loop(self)
     |      Our game loop. It calls the event loop; updates the display;
     |      restricts the framerate; and loops.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables (if defined)
     |
     |  __weakref__
     |      list of weak references to the object (if defined)

FUNCTIONS
    main()
        Prepare our environment, create a display, and start the program.

DATA
    CAPTION = 'Click to Change My Color'
    SCREEN_SIZE = (500, 500)


Messages In This Thread
pyutils module - by Skaperen - Oct-04-2016, 02:19 AM
RE: pyutils module - by Skaperen - Oct-04-2016, 04:48 AM
RE: pyutils module - by nilamo - Oct-04-2016, 07:39 PM
RE: pyutils module - by Skaperen - Oct-05-2016, 04:25 AM
RE: pyutils module - by nilamo - Oct-05-2016, 02:34 PM
RE: pyutils module - by Skaperen - Oct-06-2016, 12:33 AM
RE: pyutils module - by metulburr - Oct-04-2016, 07:49 PM
RE: pyutils module - by nilamo - Oct-04-2016, 07:53 PM
RE: pyutils module - by metulburr - Oct-04-2016, 07:58 PM
RE: pyutils module - by metulburr - Oct-05-2016, 11:43 AM
RE: pyutils module - by Mekire - Oct-08-2016, 02:24 AM
RE: pyutils module - by Skaperen - Oct-08-2016, 03:34 AM
RE: pyutils module - by Mekire - Oct-08-2016, 06:43 AM
RE: pyutils module - by Skaperen - Oct-08-2016, 07:05 AM
RE: pyutils module - by Mekire - Oct-08-2016, 04:48 PM
RE: pyutils module - by wavic - Oct-08-2016, 08:12 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pyutils.py Skaperen 8 6,332 May-09-2020, 01:22 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020