diff --git a/shablona/__init__.py b/shablona/__init__.py index 1c260fc..3f2c121 100644 --- a/shablona/__init__.py +++ b/shablona/__init__.py @@ -1,2 +1,6 @@ +#from .constants import * +CONSTANT1 = 5 +CONSTANT2 = 'i am constant' + from .shablona import * from .version import __version__ \ No newline at end of file diff --git a/shablona/constants.py b/shablona/constants.py new file mode 100644 index 0000000..1177f54 --- /dev/null +++ b/shablona/constants.py @@ -0,0 +1,2 @@ +CONSTANT1 = 5 +CONSTANT2 = 'i am constant' \ No newline at end of file diff --git a/shablona/shablona.py b/shablona/shablona.py index 5974e5f..e93bf20 100644 --- a/shablona/shablona.py +++ b/shablona/shablona.py @@ -4,6 +4,16 @@ from scipy.special import erf import scipy.optimize as opt +from shablona import CONSTANT1, CONSTANT2 + +def print_constants(): + """ + Function that prints the constants defined by the package. + This is a demonstration of the proper way to define package-wide + constants and then use them throughout the package.""" + + print 'CONSTANT1: %s' % CONSTANT1 + print 'CONSTANT2: %s' % CONSTANT2 def transform_data(data): """