PageRenderTime 13ms CodeModel.GetById 2ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/python/constants/runme.py

#
Python | 27 lines | 18 code | 8 blank | 1 comment | 0 complexity | 5af915c88c24e3156b24940d65d4cb57 MD5 | raw file
 1# file: runme.py
 2
 3import example 
 4
 5print "ICONST  =", example.ICONST, "(should be 42)"
 6print "FCONST  =", example.FCONST, "(should be 2.1828)"
 7print "CCONST  =", example.CCONST, "(should be 'x')"
 8print "CCONST2 =", example.CCONST2, "(this should be on a new line)"
 9print "SCONST  =", example.SCONST, "(should be 'Hello World')"
10print "SCONST2 =", example.SCONST2, "(should be '\"Hello World\"')"
11print "EXPR    =", example.EXPR,   "(should be 48.5484)"
12print "iconst  =", example.iconst, "(should be 37)"
13print "fconst  =", example.fconst, "(should be 3.14)"
14
15try:
16    print "EXTERN = ", example.EXTERN, "(Arg! This shouldn't print anything)"
17except AttributeError:
18    print "EXTERN isn't defined (good)"
19
20try:
21    print "FOO    = ", example.FOO, "(Arg! This shouldn't print anything)"
22except AttributeError:
23    print "FOO isn't defined (good)"
24
25
26
27