diff options
Diffstat (limited to 'scripting/examples/python/HelloWorld.py')
-rw-r--r-- | scripting/examples/python/HelloWorld.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scripting/examples/python/HelloWorld.py b/scripting/examples/python/HelloWorld.py new file mode 100644 index 000000000000..7f5b45c8cd08 --- /dev/null +++ b/scripting/examples/python/HelloWorld.py @@ -0,0 +1,13 @@ +# HelloWorld python script for the scripting framework + +def HelloWorldPython( ): + """Prints the string 'Hello World(in Python)' into the current document""" +#get the doc from the scripting context which is made available to all scripts + model = XSCRIPTCONTEXT.getDocument() +#get the XText interface + text = model.Text +#create an XTextRange at the end of the document + tRange = text.End +#and set the string + tRange.String = "Hello World (in Python)" + return None |