generated from mwc/lab_terminal
Add python file headers
This commit is contained in:
parent
4e2abe1775
commit
71e1463941
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 :)"])
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue