Skip to content

Commit 24ab957

Browse files
committed
better documenation
1 parent e1f3d05 commit 24ab957

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

src/examplepackagefb1258/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""
2+
This file is required for Python to recognize the directory as a "regular" package.
3+
4+
Python "regular" packages use the __init__.py file to initialize the package and
5+
can include package-level variables, import statements, and initialization code
6+
you wish to run when the package is first imported into a program.
7+
8+
For more information, see the official documentation:
9+
https://docs.python.org/3/reference/import.html#regular-packages
10+
"""

src/examplepackagefb1258/__main__.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1+
"""
2+
In Python packages, this file called __main__.py is run when the package is run
3+
directly from command line, as opposed to importing it into another program.
4+
"""
5+
16
import examplepackagefb1258.wisdom as wisdom
27

38

49
def main():
5-
line = wisdom.get()
6-
print(line)
10+
"""
11+
Get some wise text and print it out.
12+
"""
13+
line = wisdom.get() # get a line of text
14+
print(line) # print it out
715

816

917
if __name__ == "__main__":
18+
# run the main function
1019
main()

src/examplepackagefb1258/wisdom.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
"""
2+
This module provides a function to retrieve a pseudo-random line from Lewis Carroll's poem "The Jabberwocky".
3+
Read more about Jabberwocky here: https://en.wikipedia.org/wiki/Jabberwocky
4+
"""
5+
16
import random
27

38

0 commit comments

Comments
 (0)