examples/functions/use_mycalc.py
from __future__ import print_function

import mycalc
print(mycalc.add(19, 23))
$ python use_mycalc.py
42
examples/functions/mycalc.py
from __future__ import print_function

def self_test():
    print('Self testing  {}'.format(__file__))
    assert add(1, 1) == 2
    assert add(-1, 1) == 0
    # assert add(-99, 1) == 0 # AssertionError

def add(a, b):
    return a + b

if __name__ == '__main__':
    self_test()
$ python mycalc.py
Self testing  mycalc.py