add std_map example
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8291 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
165b0032e9
commit
532fa355ea
6 changed files with 117 additions and 0 deletions
36
SWIG/Examples/python/std_map/runme.py
Normal file
36
SWIG/Examples/python/std_map/runme.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# file: runme.py
|
||||
|
||||
import example
|
||||
|
||||
dmap = {}
|
||||
dmap["hello"] = 1.0
|
||||
dmap["hi"] = 2.0
|
||||
|
||||
print dmap.items()
|
||||
print dmap.keys()
|
||||
print dmap.values()
|
||||
|
||||
print dmap
|
||||
print example.halfd(dmap)
|
||||
|
||||
dmap = example.DoubleMap()
|
||||
dmap["hello"] = 1.0
|
||||
dmap["hi"] = 2.0
|
||||
|
||||
print dmap.items()
|
||||
print dmap.keys()
|
||||
print dmap.values()
|
||||
|
||||
hmap = example.halfd(dmap)
|
||||
print hmap.keys()
|
||||
print hmap.values()
|
||||
|
||||
|
||||
dmap = {}
|
||||
dmap["hello"] = 2
|
||||
dmap["hi"] = 4
|
||||
|
||||
hmap = example.halfi(dmap)
|
||||
print hmap
|
||||
print hmap.keys()
|
||||
print hmap.values()
|
||||
Loading…
Add table
Add a link
Reference in a new issue