diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2005-02-11 15:32:27 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2005-02-11 15:32:27 +0000 |
commit | e495fa89994808aa31c8a94d202643c9c2976ce6 (patch) | |
tree | a730523865551801621e472f0a99248681e64a5c /scripting/examples/python | |
parent | 422854eab62c3fbbe21b815e7d28e1611bc9251d (diff) |
INTEGRATION: CWS pyunofixes1 (1.1.2); FILE ADDED
2004/12/12 19:46:22 jbu 1.1.2.1: Ã#i25309# moved scripts one level higher, as files are now also container for scripts
Diffstat (limited to 'scripting/examples/python')
-rw-r--r-- | scripting/examples/python/HelloWorld.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scripting/examples/python/HelloWorld.py b/scripting/examples/python/HelloWorld.py new file mode 100644 index 000000000000..cc634c265bfb --- /dev/null +++ b/scripting/examples/python/HelloWorld.py @@ -0,0 +1,14 @@ +# 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 XTextCursor + cursor = text.createTextCursor() +#and insert the string + text.insertString( cursor, "Hello World (in Python)", 0 ) + return None + |