swig/Examples/python/constants/example.py
Dave Beazley b3e124ac21 Updated some examples
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@490 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-06-17 21:41:01 +00:00

25 lines
709 B
Python

# file: example.py
import example
print "ICONST =", example.ICONST, "(should be 42)"
print "FCONST =", example.FCONST, "(should be 2.1828)"
print "CCONST =", example.CCONST, "(should be 'x')"
print "SCONST =", example.SCONST, "(should be 'Hello World')"
print "EXPR =", example.EXPR, "(should be 48.5484)"
print "iconst =", example.iconst, "(should be 37)"
print "fconst =", example.fconst, "(should be 3.14)"
try:
print "EXTERN = ", example.EXTERN, "(Arg! This shouldn't print anything)"
except AttributeError:
print "EXTERN isn't defined (good)"
try:
print "FOO = ", example.FOO, "(Arg! This shouldn't print anything)"
except AttributeError:
print "FOO isn't defined (good)"