diff --git a/adventure/seafloor/coral_reef/chest.py b/adventure/seafloor/coral_reef/chest.py index c609bd7..bdba041 100644 --- a/adventure/seafloor/coral_reef/chest.py +++ b/adventure/seafloor/coral_reef/chest.py @@ -1,4 +1,8 @@ -# This is a Python program. You should run it by typing "chest.py" +# chest.py +# -------- +# By MWC Contributors +# +# This is a Python program. You should run it by typing `python chest.py`. import os from pathlib import Path diff --git a/adventure/seafloor/sunken_ship/galley/ghost.py b/adventure/seafloor/sunken_ship/galley/ghost.py index da88ece..cc79354 100644 --- a/adventure/seafloor/sunken_ship/galley/ghost.py +++ b/adventure/seafloor/sunken_ship/galley/ghost.py @@ -1,4 +1,8 @@ -# This is a Python file. You can run it by typing "python ghost.py" +# ghost.py +# -------- +# By MWC Contributors +# +# This is a Python program. You can run it by typing `python ghost.py` import sys from pathlib import Path diff --git a/adventure/seafloor/sunken_ship/stateroom/desk.py b/adventure/seafloor/sunken_ship/stateroom/desk.py index cab05a3..b419385 100644 --- a/adventure/seafloor/sunken_ship/stateroom/desk.py +++ b/adventure/seafloor/sunken_ship/stateroom/desk.py @@ -1,4 +1,8 @@ -# This is a Python program. You can run it by typing "python desk.py" +# desk.py +# -------- +# By MWC Contributors +# +# This is a Python program. You can run it by typing `python desk.py` import sys from pathlib import Path diff --git a/fancy_printing.py b/fancy_printing.py index d123ca7..ca74114 100644 --- a/fancy_printing.py +++ b/fancy_printing.py @@ -1,10 +1,25 @@ +# fancy_printing.py +# ----------------- +# By MWC Contributors +# +# This module defines the `fancy_printing` function, +# which nicely formats and prints a list of strings. +# All the other python programs in this lab import +# `fancy_printing`. + from click import secho from textwrap import wrap def print_fancy(paragraphs): + """Formats and prints paragraphs. + `paragraphs` should be a list of strings. + """ for paragraph in paragraphs: wrapped_text = wrap(paragraph, initial_indent=' ', subsequent_indent=' ') for line in wrapped_text: secho(line, fg='cyan') print('') +if __name__ == '__main__': + print_fancy(["This is a just a helper program :)"]) + diff --git a/return_to_ship.py b/return_to_ship.py index 8f48535..098be0c 100644 --- a/return_to_ship.py +++ b/return_to_ship.py @@ -1,3 +1,9 @@ +# return_to_ship.py +# ----------------- +# By MWC Contributors +# +# This is a Python program. You should run it by typing `python return_to_ship.py`. + from shutil import rmtree from pathlib import Path from datetime import datetime