Oct-08-2016, 06:43 AM
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:
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)