Skip to content

Instantly share code, notes, and snippets.

@lucpet
Last active December 22, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucpet/6482123 to your computer and use it in GitHub Desktop.
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.
"""
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