Updated some examples
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@490 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
905fb9b3b6
commit
b3e124ac21
22 changed files with 745 additions and 96 deletions
25
Examples/python/constants/example.py
Normal file
25
Examples/python/constants/example.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# 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)"
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue