Skip to content

Commit

Permalink
mymodule example code.
Browse files Browse the repository at this point in the history
  • Loading branch information
kushaldas committed Aug 9, 2014
1 parent 83866b1 commit 0fe49fc
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
4 changes: 4 additions & 0 deletions code/mymodule/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import mymodule.bars as bars
from mymodule.bars import simplebar
__all__ = [bars, simplebar]

37 changes: 37 additions & 0 deletions code/mymodule/bars.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""
Bars Module
============
This is an example module which provides different ways to print bars.
"""

def starbar(num):
"""
Prints a bar with *
:arg num: Length of the bar
"""
print('*' * num)

def hashbar(num):
"""
Prints a bar with #
:arg num: Length of the bar
"""
print('#' * num)

def simplebar(num):
"""
Prints a bar with -
:arg num: Length of the bar
"""
print('-' * num)

if __name__=='__main__':
simplebar(20)

0 comments on commit 0fe49fc

Please sign in to comment.