From e495fa89994808aa31c8a94d202643c9c2976ce6 Mon Sep 17 00:00:00 2001
From: Jens-Heiner Rechtien
Date: Fri, 11 Feb 2005 15:32:27 +0000
Subject: 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
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
scripting/examples/python/HelloWorld.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
create mode 100644 scripting/examples/python/HelloWorld.py
(limited to 'scripting')
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
+
--
cgit