/[ascend]/trunk/models/johnpye/extpy/extpytest.py
ViewVC logotype

Contents of /trunk/models/johnpye/extpy/extpytest.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 875 - (show annotations) (download) (as text)
Sat Oct 7 06:26:34 2006 UTC (19 years, 1 month ago) by johnpye
File MIME type: text/x-python
File size: 439 byte(s)
Can now access the ASCEND model from an external python script method. The API is not at all nice, but it's basically working now.
1 import extpy;
2 browser = extpy.getbrowser()
3
4 import ascpy;
5
6 def mypythonmethod(inst):
7 inst = ascpy.Registry().getInstance('context')
8 print "HELLO FROM PYTHON"
9 for i in inst.getChildren():
10 print i.getName()," = ",i.getValue()
11
12 """I don't want to talk to you no more, you empty headed animal food trough wiper!"""
13 browser.reporter.reportNote("No, now go away or I shall taunt you a second time!")
14
15 extpy.registermethod(mypythonmethod)

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22