Last active
December 22, 2015 13:58
-
-
Save lucpet/6482123 to your computer and use it in GitHub Desktop.
Bars Module
============
This is an example module with provide different ways to print bars.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Bars Module | |
============ | |
This is an example module with provide different ways to print bars. | |
""" | |
def starbar(num): | |
''' (int) -> integer | |
Prints a bar with * | |
>>> bars.starbar(10) | |
********** | |
''' | |
print('*' * int(num)) | |
def hashbar(num): | |
''' (int) -> integer | |
Prints a bar with # | |
>>> bars.hashbar(10) | |
########## | |
''' | |
print('#' * (num)) | |
def hash_dashbar(num): | |
''' (int) -> integer | |
Prints a bar with # | |
>>> bars.hash_dashbar(10) | |
#--------- | |
''' | |
print('#' + '-' * (num-1)) | |
# print('#'.ljust int(num, '-')) | |
def simplebar(num): | |
''' (int) -> integer | |
Prints a bar with - | |
>>> bars.simplebar(10) | |
---------- | |
''' | |
print('-' * int(num)) | |
def lp_header(): | |
""" | |
Prints a header for my py files | |
""" | |
hash_dashbar(80) | |
print("# Filename:\t\n# Copyright:\tLuke Pettit\n# Date:\t\t\t / /2013") | |
hash_dashbar(80) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment