<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mauricio</id>
	<title>Apache OpenOffice Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mauricio"/>
	<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/wiki/Special:Contributions/Mauricio"/>
	<updated>2026-05-25T14:36:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Pyuno007.png&amp;diff=161523</id>
		<title>File:Pyuno007.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Pyuno007.png&amp;diff=161523"/>
		<updated>2010-03-29T20:39:46Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: Cuadro de mensaje de pregunta&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Cuadro de mensaje de pregunta&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Pyuno006.png&amp;diff=161521</id>
		<title>File:Pyuno006.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Pyuno006.png&amp;diff=161521"/>
		<updated>2010-03-29T19:52:07Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: Mensaje informativo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Mensaje informativo&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=OOoES/Desarrollo/PyUNO_ES_bak&amp;diff=157035</id>
		<title>OOoES/Desarrollo/PyUNO ES bak</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=OOoES/Desarrollo/PyUNO_ES_bak&amp;diff=157035"/>
		<updated>2010-02-11T05:54:15Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== El conector de Python-Uno ==&lt;br /&gt;
Traducido por: Alexandro Colorado&lt;br /&gt;
&lt;br /&gt;
=== Introducción ===&lt;br /&gt;
El conector de python-Uno o PyUno te permite usar el API estandard de OpenOffice.org desde el tan bien conocido lenguaje llamado python. Tambié te permite desarrollar componentes en python, aunque los componentes de PyUno pueden ser corridos durante el proceso dentro de la suite, este tambien puede ser conjugado desde Java, C++ o ser construido desde el lenguaje StarBasic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
La versión original de este documento lo puedes encontrar en http://udk.openoffice.org/python/python-bridge.html&lt;br /&gt;
&lt;br /&gt;
=== Descargas ===&lt;br /&gt;
&lt;br /&gt;
Puedes descargar esta documentaci&amp;amp;oacuten incluyendo sus ejemplos y archivos de apoyo para este nuevo modo de trabajo basado en scripting para trabajos no en linea.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Descarga pyuno-docs.zip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Estado ===&lt;br /&gt;
El conector de PyUno esta completado, pero no ha sido empleado por suficiente gente, así que puede contener algunos errores. Ahora esta integrado a la fuente de OpenOffice.org 1.1. Aunque no corre con el la fuente de las versiones 1.0 para atras.&lt;br /&gt;
&lt;br /&gt;
Actualmente la documentación esta enfocada a desarrolladores, que cuentan con la suficiente experiencia en el API nativo de OpenOffice.org y que lo han usado bajo otro lenguaje(Java/C++/StarBasic). Si eres un novato y sientes que alguna información es requerida, te sugerimos buscarla en la &amp;quot;La Guía del Desarrollador&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== El Tutorial PyUno para OpenOffice.org ===&lt;br /&gt;
En este tutorial, mostramos como se puede usar el conector PyUNO para automatizar tareas dentro de OpenOffice.org. Este documento no es un tutorial de OpenOffice.org existen ya muchos documentos enfocados a esta actividad. A continuación mostraremos los pasos a seguir dentro de PyUNO&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Instalación de PyUNO ====&lt;br /&gt;
Desde la versión OpenOffice.org 1.1 RC4 para arriba, PyUNO es incluido en la instalación por default. Si tienes una versió anterior a esta puedes saltar el proximo parrafo.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Al Usar OpenOffice.org 1.1RC3 o antes, el conector de PyUNO debe ser seleccionado manualmente para su instalación. Escoga entonces la instalación personalizada.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
y activa el conector de Python-Uno en los componentes opcionales&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Tambien puedes instalar PyUNO despues de la instalación inicial, corriendo la instalación de OpenOffice.org sombre si misa y seleccionando Modificar en el siguiente dialogo.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nota: Cuando inicias el script de comienzo (eg. install --prefix=/usr/local) para instalación, solo puedes comenzar python despues de la instalación, solo puedes instalar pyuno despues de haber ejecutado el script setup /net y escogido Modify. Nota, que OOo Rc2 el cual no instala dos archivos ini como deviera.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Modo del conector PyUNO ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PyUNO puede usar dos metodologías diferentes:&lt;br /&gt;
Dentro del ejecutable de Python(y fuera del proceso de OpenOffice.org).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usa esta metodología cuando: &lt;br /&gt;
Comienzes a usar python (tiene un enfoque mas intuitivo.&lt;br /&gt;
quieres apuntar a ejecuciones del script comenzando procesos separados (ie. cgi-script dentro de un http-server.&lt;br /&gt;
Quieres un retorno rapido de codigo-ejecución codigo-ejecución.&lt;br /&gt;
&lt;br /&gt;
   Hola Mundo&lt;br /&gt;
&lt;br /&gt;
Asegurate, de que OOo no este corriendo(cierra el QuickStarter tambien). Activa una terminal ya sea cmd en WinNT+, command en Win9x o bash en *nix. Ve al directorio donde reside el programa de OpenOffice.org y activa OOo con los siguientes parametros.&lt;br /&gt;
:\Program Files\OpenOffice1.1\program&amp;gt;  soffice &amp;quot;-accept=socket,host=localhost,port=2002;urp;&amp;quot; &lt;br /&gt;
&lt;br /&gt;
Ahora comienza el archivo hello_world.py con tu editor de texto favorito e incluye el siguiente codigo.&lt;br /&gt;
&amp;lt;code&amp;gt;[python] import uno&lt;br /&gt;
&lt;br /&gt;
# get the uno component context from the PyUNO runtime&lt;br /&gt;
localContext = uno.getComponentContext()&lt;br /&gt;
&lt;br /&gt;
# create the UnoUrlResolver &lt;br /&gt;
resolver = localContext.ServiceManager.createInstanceWithContext(&lt;br /&gt;
&amp;quot;com.sun.star.bridge.UnoUrlResolver&amp;quot;, localContext )&lt;br /&gt;
&lt;br /&gt;
# connect to the running office &lt;br /&gt;
ctx = resolver.resolve( &amp;quot;uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext&amp;quot; )&lt;br /&gt;
smgr = ctx.ServiceManager&lt;br /&gt;
&lt;br /&gt;
# get the central desktop object&lt;br /&gt;
desktop = smgr.createInstanceWithContext( &amp;quot;com.sun.star.frame.Desktop&amp;quot;,ctx)&lt;br /&gt;
&lt;br /&gt;
# access the current writer document&lt;br /&gt;
model = desktop.getCurrentComponent()&lt;br /&gt;
&lt;br /&gt;
# access the document&amp;#039;s text property&lt;br /&gt;
text = model.Text&lt;br /&gt;
&lt;br /&gt;
# create a cursor&lt;br /&gt;
cursor = text.createTextCursor()&lt;br /&gt;
&lt;br /&gt;
# insert the text into the document&lt;br /&gt;
text.insertString( cursor, &amp;quot;Hello World&amp;quot;, 0 )&lt;br /&gt;
&lt;br /&gt;
# Do a nasty thing before exiting the python process. In case the&lt;br /&gt;
# last call is a oneway call (e.g. see idl-spec of insertString),&lt;br /&gt;
# it must be forced out of the remote-bridge caches before python&lt;br /&gt;
# exits the process. Otherwise, the oneway call may or may not reach&lt;br /&gt;
# the target object.&lt;br /&gt;
# I do this here by calling a cheap synchronous call (getPropertyValue).&lt;br /&gt;
ctx.ServiceManager&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ejecuta el script pasado con el siguiente comando&lt;br /&gt;
   c:\Program Files\OpenOffice1.1\program&amp;gt; .\python hello_world.py &lt;br /&gt;
&lt;br /&gt;
Este script escribe la cadena Hello World dentro del documento OpenWriter&lt;br /&gt;
&lt;br /&gt;
==== Dentro del proceso de OpenOffice.org ====&lt;br /&gt;
 &lt;br /&gt;
Usa este modo cuando:&lt;br /&gt;
* Quieras facilmente ejecutar tu codigo en multiples maquinas&lt;br /&gt;
* Tu codigo sea necesitado por llamadas de otros programas&lt;br /&gt;
* Tienes mas experiencia con el funcionamiento de PyUNO.&lt;br /&gt;
* Quieres que tu codigo corra con el mejor desempeño&lt;br /&gt;
Hola Mundo&lt;br /&gt;
&lt;br /&gt;
El ejemplo siguiente esta guardado como un componente de UNO, esto significa, que el codigo que ejecuta la insersion necesita ser embedido en una class de python. Aparte, el codigo-de-conexion a la suite necesita ser remplazado por un punto clave, el cual usa el cargador de python para iniciar una clase de python.&lt;br /&gt;
hello_world.py&lt;br /&gt;
&amp;lt;code&amp;gt;[python]import uno&lt;br /&gt;
import unohelper&lt;br /&gt;
&lt;br /&gt;
from com.sun.star.task import XJobExecutor&lt;br /&gt;
&lt;br /&gt;
# implement a UNO component by deriving from the standard unohelper.Base class&lt;br /&gt;
# and from the interface(s) you want to implement.&lt;br /&gt;
class HelloWorldJob( unohelper.Base, XJobExecutor ):&lt;br /&gt;
    def __init__( self, ctx ):&lt;br /&gt;
        # store the component context for later use&lt;br /&gt;
        self.ctx = ctx&lt;br /&gt;
        &lt;br /&gt;
    def trigger( self, args ):&lt;br /&gt;
        # note: args[0] == &amp;quot;HelloWorld&amp;quot;, see below config settings&lt;br /&gt;
    &lt;br /&gt;
        # retrieve the desktop object&lt;br /&gt;
        desktop = self.ctx.ServiceManager.createInstanceWithContext(&lt;br /&gt;
            &amp;quot;com.sun.star.frame.Desktop&amp;quot;, self.ctx )&lt;br /&gt;
    &lt;br /&gt;
        # get current document model&lt;br /&gt;
        model = desktop.getCurrentComponent()&lt;br /&gt;
&lt;br /&gt;
        # access the document&amp;#039;s text property&lt;br /&gt;
        text = model.Text&lt;br /&gt;
&lt;br /&gt;
        # create a cursor&lt;br /&gt;
        cursor = text.createTextCursor()&lt;br /&gt;
&lt;br /&gt;
        # insert the text into the document&lt;br /&gt;
        text.insertString( cursor, &amp;quot;Hello World&amp;quot;, 0 )&lt;br /&gt;
&lt;br /&gt;
# pythonloader looks for a static g_ImplementationHelper variable&lt;br /&gt;
g_ImplementationHelper = unohelper.ImplementationHelper()&lt;br /&gt;
&lt;br /&gt;
# &lt;br /&gt;
g_ImplementationHelper.addImplementation( \&lt;br /&gt;
        HelloWorldJob,                        # UNO object class&lt;br /&gt;
        &amp;quot;org.openoffice.comp.pyuno.demo.HelloWorld&amp;quot;, # implemenation name&lt;br /&gt;
                                      # Change this name for your own&lt;br /&gt;
      # script &lt;br /&gt;
        (&amp;quot;com.sun.star.task.Job&amp;quot;,),)          # list of implemented services&lt;br /&gt;
                                      # (the only service)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
El codigo necesita ser enlazado a un evento. Esto puede hacerce configurando estas opciones.&lt;br /&gt;
Addons.xcu: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Both files must be packaged up into a single zip file by using your favourite zip utility, e.g. infozip&lt;br /&gt;
&amp;lt;code&amp;gt;[bash]zip hello_world.zip Addons.xcu hello_world_comp.py&lt;br /&gt;
  adding: Addons.xcu (deflated 55%)&lt;br /&gt;
  adding: hello_world_comp.py (deflated 55%)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Estos paquetes pueden ser implementados dentro de una instalación de OpenOffice.org usando la herramienta &lt;br /&gt;
pkgchk&lt;br /&gt;
, el cual esta ubicada en el directorio de program dentro de OOo. Se advierte que OOo debe de estar completamente cerrado. &lt;br /&gt;
  c:\Program Files\OpenOffice.org1.1\program&amp;gt; pkgchk hello_world.zip&lt;br /&gt;
  c:\Program Files\OpenOffice.org1.1\program&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Si el proceso se realiza con exito, no tendras ningun reotorno de la herramienta. Y cuando comienzes de nuevo OOo, encontraras una nueva entrada del menu (ver Tools / Aditional Components / Insert Hello World).&lt;br /&gt;
&lt;br /&gt;
Como puedes ver las lineas de los scripts bases son identicas, pero la forma para extraer los componentes de office difieren.&lt;br /&gt;
Ejemplos&lt;br /&gt;
* ooextract.py- Una herramienta de linea de comando la cual extrae el contenido de un archivo creado con OpenOffice.org en un modo stout.&lt;br /&gt;
* swriter.py- Herramienta de linea de comando la cual crea y llena un documento de Writer con cierto texto y tablas con formato.&lt;br /&gt;
* swritercomp.py y swritercompclient.pyIgual que la anterior pero esta esta en modo componente UNO, asi que corre dentro de OpenOffice.org. Uno puede ver la mejora en el desempeño corriendo el componente como un proceso.&lt;br /&gt;
biblioaccess.py- Herramienta de linea de comando, que presenta el contenido del la base de datos, biblio, que incluye OpenOffice.org&lt;br /&gt;
&lt;br /&gt;
=== Conexión al lenguaje UNO ===&lt;br /&gt;
&lt;br /&gt;
A continuación encontrarás la completa descripción de las herramientas UNO se conectan con el lenguaje de Python.&lt;br /&gt;
El typo de mapeo UNOEl tipo de dato IDL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
tipos de enteros (byte, short, unsigned long, hyper, unsigned hyper	Representación en Python&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python solo conoce los datatypes encontrados en C long y long long como tipos de enteros. En la mayor parte de las maquinas, un long es un valor de 32 bit mientras long long es de 64 bits.&lt;br /&gt;
* Valores de UNO (por ejemplo, retorno del valor de un metodo UNO)&lt;br /&gt;
* Valores que tiene los tipos byte, short, unsigned short, long o unsigned, long son convertidos a un valor python long. &lt;br /&gt;
* Valores que tienen un tipo de hyper u unsigned hyper son convertidos a python como long long.&lt;br /&gt;
* Valores enviados a UNO (por ejemplo, el argumento de un metodo UNO)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Si hay un tipo concreto en el metodo IDL, el valor es convertido a un tipo concreto (de hecho el servicio de invoación hace este trabajo). Si el metodo solo contiene un any, cada valor del entero será convertido al typo de dato mas pequeño, donde el valor se ajusta y lo manda al objeto UNO (así que 5 se convierte en un byte, 150 se vuelve short, 0x1f023 un long y los valores mayores a 0xffffffff se convierten en un hyper.&lt;br /&gt;
boolean	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python tiene, internamente un datatype buleano, el cual es derivado del tipo de entero (ver http://python.org/peps/pep-0285.html ). Ahí existe el True y False, el cual PyUNO usa para distinguir entre valores integrales o buleanos.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mientras el buleano sea especificado en el metodo de interfaz, podrás seguir usando numeros. En los ejemplos siguientes, todas las llamadas son validas:&lt;br /&gt;
&amp;lt;code&amp;gt;[python]#idl signature void takeBool( [in] boolean bool )&lt;br /&gt;
unoObject.takeBool( 1 ) # valid, passing true (PyUNO runtime&lt;br /&gt;
# does the conversion&lt;br /&gt;
unoObject.takeBool( True) ) # valid, passing true&lt;br /&gt;
unoObject.takeBool( False ) # valid, passing false&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Si embargo, cuando quieres especificamente pasar un buleano, cuando solo any es especificado, tu debes usar True y False.&lt;br /&gt;
idl signature void foo( [in] any value )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[python]# implementation expects a boolean (which is separately documented&lt;br /&gt;
# e.g. in the service specification.&lt;br /&gt;
unoObject.foo( True ) # valid, pass a true&lt;br /&gt;
unoObject.foo( 1 )    # bad, just passing a 1, implementation will&lt;br /&gt;
                      # probably not be able to deal with it correctly.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nota: Tambien existe el uso de la clase uno.Bool, el cual es no es usado desde pyuno 0.9.2 aunque se sigue soportando. Ya no lo usen.&lt;br /&gt;
string	En general, la cadena esta mapeada dentro de la cadena-unicodigo de python. Sin embargo, quizas pases una cadena de 8-bits cuando se espere una cade de UNO, el conector convierte los 8-bits a una cadena-unicodigo usando el locale del sistema. &lt;br /&gt;
&amp;lt;code&amp;gt;[python]# idl signatore foo( [in] string value )&lt;br /&gt;
# both lines are valid&lt;br /&gt;
unoObject.foo( u&amp;#039;my foo string&amp;#039; )&lt;br /&gt;
unoObject.foo( &amp;#039;my foo string&amp;#039; )&lt;br /&gt;
char	Un char es mapeado a un uno.Char. Tiene el miembro de una cadena-unicodigo publico con lenght 1 como contenedor del char unicodigo. &lt;br /&gt;
# idl signature foo( [in] char c)&lt;br /&gt;
unoObject.foo( uno.Char( u&amp;#039;h&amp;#039; ) )  #valid&lt;br /&gt;
unoObject.foo( &amp;#039;h&amp;#039; )               #wrong&lt;br /&gt;
	  &lt;br /&gt;
enum	&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Un valor enum es representado concretamente por una instancia de la clase uno.Enum. Tiene dos miembros, typeName es una string conteniendo el nombre del tipo enum y value contiene el valor de enum.&lt;br /&gt;
&lt;br /&gt;
Puedes concretar los valores de enum de dos formas:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.(suggested) by importing&lt;br /&gt;
  from enumname import enumvalue. &lt;br /&gt;
&lt;br /&gt;
E.g. &lt;br /&gt;
[code]from com.sun.star.uno.TypeClass import UNSIGNED_LONG&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
unoObject.setValue( UNSIGNED_LONG )&lt;br /&gt;
if unoObject.getValue() == UNSIGNED_LONG:[/code]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.(in rare situations)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[python]import uno&lt;br /&gt;
     &lt;br /&gt;
unoObject.setValue( uno.Enum( &amp;quot;com.sun.star.uno.TypeClass&amp;quot;, &amp;quot;UNSIGNED_LONG&amp;quot;) )&lt;br /&gt;
if unoObject.getValue() == uno.Enum( &amp;quot;com.sun.star.uno.TypeClass&amp;quot;, &amp;quot;UNSIGNED_LONG&amp;quot;):&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
La primera soluci&amp;amp;ooacute;n tiene la ventaja de que en caso de el fallo en enum manda una RunTimeException o excepción del tiempo de proceso al momento que la fuente de python es importada.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;type	&amp;#039;&amp;#039;&lt;br /&gt;
Un tipo se mapea a uno.type . Tiene miembros publicos llamados typeName (cadenas) y typeClass (el valor enum de com.sun.star.uno.TypeClass). Ahi existe una función uno.getTypeByName() para facilmente crear una instancia de type, las funciones crean un RunTimeException en caso que el type no se conosca.&lt;br /&gt;
&lt;br /&gt;
Puedes crear valores concretos de dos formas:&lt;br /&gt;
1. from module-where-type-lives-in import typeOfTypeName. &lt;br /&gt;
&lt;br /&gt;
E.g. to create XComponent&amp;#039;s type, use &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
from com.sun.star.lang import typeOfXComponent&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
unoObject.setType( typeOfXComponent )&lt;br /&gt;
if unoObject.getType() == typeOfXComponent:	  &lt;br /&gt;
&lt;br /&gt;
2.(in rare situations, e.g. for types of simple values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[python]&lt;br /&gt;
import uno&lt;br /&gt;
     &lt;br /&gt;
unoObject.setType( uno.getTypeByName( &amp;quot;com.sun.star.uno.XComponent&amp;quot; ) )&lt;br /&gt;
if unoObject.getType() == uno.getTypeByName( &amp;quot;com.sun.star.uno.XComponent&amp;quot;):&lt;br /&gt;
struct (and exception)	&amp;lt;/code&amp;gt;&lt;br /&gt;
Para cada uno struct (o excepción), una nueva clase de python es generada al vuelo. La clase generada refleja la jerarquia heredada del tipo UNO (es importante para el administrador de excepciones, ver abajo).&lt;br /&gt;
&lt;br /&gt;
Uno puede generar una clase struct usando el mecanismo de importación. Una instanacia del struct puede entonces ser instanciada usando el constructor de python. El constructor soporta el argumento cero (miembros obtienen el constructor default), 1 argumento con el mismo tipo (copia el constructor), y n argumentos, donde n es el nombre de elementos que contiene el struct. El struct soporta el operador de equality, dos struct son iguales, si son del mismo type y cada miembro es igual.&lt;br /&gt;
&lt;br /&gt;
Ejemplo.&lt;br /&gt;
&amp;lt;code&amp;gt;[python]&lt;br /&gt;
from com.sun.star.beans import PropertyValue&lt;br /&gt;
from com.sun.star.uno import Exception,RuntimeException&lt;br /&gt;
&lt;br /&gt;
propVal = PropertyValue()                 # Default constructor&lt;br /&gt;
propVal.Name = &amp;quot;foo&amp;quot;&lt;br /&gt;
propVal.Value = 2&lt;br /&gt;
&lt;br /&gt;
if propVal == PropertyValue( &amp;quot;foo&amp;quot;, 2 ):  # Memberwise constructor&lt;br /&gt;
   # true !&lt;br /&gt;
   pass&lt;br /&gt;
&lt;br /&gt;
if propVal == PropertyValue( propVal ):   # Copy Constructor&lt;br /&gt;
   # true &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Una instancia del struct UNO puede ser inicialmente construida de la función uno.createUnoStruct() y pasando el nombre de la struct como el primer parametro y el argumento opcional del constructor (ver arriba para un ejemplo de un posible ctors).&lt;br /&gt;
&lt;br /&gt;
ATENCION: En UNO, struct tiene el valor semantico, sin embargo, la manera como se maneja en python no refleja esto. Cuando el struct es pasado de un parametro a una funcion, el valor es pasado la funcion llamada. Las siguientes modificaciones a la instancia de la struct no afectaran a la funcion llamada. Sin embargo, la simple asignaci&amp;amp;oactue;n de una struct a otra variable local no crea una copia, simplemente crea un alias de la instancia original.&lt;br /&gt;
&amp;lt;code&amp;gt;[python]&lt;br /&gt;
struct = uno.createUnoStruct( &amp;quot;com.sun.star.beans.PropertyValue&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
struct.Name = &amp;quot;foo&amp;quot;&lt;br /&gt;
struct2 = struct&lt;br /&gt;
struct2.Name = &amp;quot;python&amp;quot;           # modifies also struct, probably not desired !&lt;br /&gt;
unoObject.call( struct, struct2 ) # passes the same struct 2 times !&lt;br /&gt;
&lt;br /&gt;
struct.Name = &amp;quot;doobidooo&amp;quot;         # even worse style. If the UNO object is implemented&lt;br /&gt;
                                  # in python, you possibly modify the callee&amp;#039;s value.&lt;br /&gt;
  # Don&amp;#039;t do this !&lt;br /&gt;
sequence	&amp;lt;/code&amp;gt;&lt;br /&gt;
Una secuencia generalmente esta trazada a una tupla de python. Una lista de de python (!) no es aceptada.&lt;br /&gt;
&amp;lt;code&amp;gt;[python]# idl signature XInterface createInstanceWithArguments(&lt;br /&gt;
#                        [in] string servicename,  [in] sequence  )&lt;br /&gt;
doc = smgr.createInstanceWithArguments( &amp;quot;foo.service&amp;quot;, (&amp;quot;arg1&amp;quot;,2))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Atención desde la version 0.9.2 El idl sequence&amp;lt;byte&amp;gt; es trazado a la clase uno.ByteSquence. Tiene un miembro cadena llamado value, el cual contiene los datos de la secuencia de byte. Tal como la bytesequence es generalmente un contenedor para datos binarios, esta clase permite manejar binarios eficientemente. Esto tambien embede pyuno a python, ya que python mantiene datos binarios en cadenas.&lt;br /&gt;
&amp;lt;code&amp;gt;[python]# idl signature writeBytes( [in] sequence%lt; byte &amp;gt; data )&lt;br /&gt;
#&lt;br /&gt;
out.writeBytes( uno.ByteSequence( &amp;quot;abc&amp;quot; ) )&lt;br /&gt;
&lt;br /&gt;
# you could also write the following&lt;br /&gt;
begin = uno.ByteSequence( &amp;quot;ab&amp;quot; )&lt;br /&gt;
out.writeBytes( begin + &amp;quot;c&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
# but this does not work !&lt;br /&gt;
out.writeBytes( &amp;quot;abc&amp;quot; ) # ERROR, no implict conversion supported by the runtime !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# idl signature long readBytes( [out] sequence , [in] length )&lt;br /&gt;
len,seq = in.readBytes( dummy, 3 )&lt;br /&gt;
&lt;br /&gt;
# the statements do the same thing &lt;br /&gt;
print seq == &amp;quot;abc&amp;quot;:&lt;br /&gt;
print seq == uno.ByteSequence( &amp;quot;abc&amp;quot; )&lt;br /&gt;
constants	&amp;lt;/code&amp;gt;&lt;br /&gt;
Una constante UNO idl puede ser dada por diferentes maneras:&lt;br /&gt;
Usa el valor concreto especificado en el archivo idl&lt;br /&gt;
Una constante es su valor y solo su valor. Ya que las modificaciones de los valores de la contacia es incompatible.&lt;br /&gt;
Usa el mecanismo de importación para crear variables con un nombre constante&lt;br /&gt;
La solución es la mas leida.&lt;br /&gt;
Usauno.getConstatByName()&lt;br /&gt;
puede ser util de vez en cuando. Las funciones RunTimeException se ejecutan en caso que la constante sea desconocida. &lt;br /&gt;
&amp;lt;code&amp;gt;[python]from com.sun.star.beans.PropertyConcept import ATTRIBUTES&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# the following 3 lines are equivalent&lt;br /&gt;
unoObject.setConcept( ATTRIBUTES )&lt;br /&gt;
unoObject.setConcept( 4 )&lt;br /&gt;
unoObject.setConcept( uno.getConstantByName( &amp;quot;com.sun.star.beans.PropertyConcept.ATTRIBUTES&amp;quot; ) )&lt;br /&gt;
any	&amp;lt;/code&amp;gt;&lt;br /&gt;
En general el programador en python nunca llega a tener contacto con anys. Si alguna vez saliera any en un metodo, el programador puede tan solo pasar un valor concreto. Consecuentemente, los retornos de valores o parametros tambien nunca contiene un any concreto.&lt;br /&gt;
&lt;br /&gt;
Sin embargo, hay ciertas circumstancias, donde el programdor de python quiera pasar un valor type concreto a una funcion que llame (nota, esto es solo posible para llamadas del &amp;#039;conector&amp;#039;, no puedes pasar un valor de type a ningun otro objeto python-uno).&lt;br /&gt;
&lt;br /&gt;
Puedes crear un uno.Any( ), pasando el type ( como typename o como uno.Type) y su valor.&lt;br /&gt;
&amp;lt;code&amp;gt;[python]# constructs a uno.Any, that contains a byte&lt;br /&gt;
byteAny = uno.Any( &amp;quot;byte&amp;quot; , 5 )&lt;br /&gt;
&lt;br /&gt;
# constructs a sequences of shorts&lt;br /&gt;
byteAny = uno.Any( &amp;quot;[]short&amp;quot;, (4,5))&amp;lt;/code&amp;gt;&lt;br /&gt;
	  &lt;br /&gt;
&lt;br /&gt;
Estas anys solo pueden ser usadas junto con el uno.invoke, el cual permite invocar un metodo dentro de un objeto arbitrario con un type any.&lt;br /&gt;
&amp;lt;code&amp;gt;[python]# the normal call&lt;br /&gt;
uno.setPropertyValue( &amp;quot;foo&amp;quot;, (4,5))&lt;br /&gt;
&lt;br /&gt;
# the uno.invoke call&lt;br /&gt;
uno.invoke( obj, &amp;quot;setPropertyValue&amp;quot; , (&amp;quot;foo&amp;quot;,uno.Any( &amp;quot;[]short&amp;quot;, (4,5))) )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cuando obj es un objeto conectado, la funcion que se llama obtiene la secuencia como una sequence(short). Cuando obj es un objeto local de python, solo obtiene el (4,5) como si lo hubiera obtenido con la llamada normal.&lt;br /&gt;
&lt;br /&gt;
=== Implementando los objetos UNO ===&lt;br /&gt;
Podras usar clases de python para implementar los objetos UNO. Instancias de python pueden ser pasadas como argumentos a llamados de UNO donde los anys o interfaces concretas hayan sido especificadas.&lt;br /&gt;
&lt;br /&gt;
Para ser un objeto UNO, una clase de python DEBE implementar la interface com.sun.star.lang.XTypeProvider implementando los metodos getTypes() y getImplementationID(), el cual informa el bridge de python, sobre cual UNO concreta la interfaz con la clase que implementa python. La funci&amp;amp;ooacute;n de getTypes() define que interfaz son definidas por las clases.&lt;br /&gt;
&lt;br /&gt;
Para hacer esto mas fácil, existe una clase unohelper.Base, donde uno objeto UNO de python se originara de el. Tu puedes entonces implementar una interfaz UNO simpmente originandolo de la interfaz preferida. El siguiente ejemplo implementa la interfaz com.sun.star.lang.XTypeProvider, el cual almacena toda la información escrita en el espacion de una ByteSequence(). (Nota: esta implementació es bastante pobre y es solo con propositos de demostración.&lt;br /&gt;
&amp;lt;code&amp;gt;[python]import unohelper&lt;br /&gt;
from com.sun.star.io import XOutputStream&lt;br /&gt;
class SequenceOutputStream( unohelper.Base, XOutputStream ):&lt;br /&gt;
      def __init__( self ):&lt;br /&gt;
          self.s = uno.ByteSequence(&amp;quot;&amp;quot;)&lt;br /&gt;
          self.closed = 0&lt;br /&gt;
          &lt;br /&gt;
      def closeOutput(self):&lt;br /&gt;
          self.closed = 1&lt;br /&gt;
&lt;br /&gt;
      def writeBytes( self, seq ):&lt;br /&gt;
          self.s = self.s + seq&lt;br /&gt;
&lt;br /&gt;
      def flush( self ):&lt;br /&gt;
          pass&lt;br /&gt;
&lt;br /&gt;
      def getSequence( self ):&lt;br /&gt;
          return self.s&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Desde la lista de clases bases, la implementación unohelper.Base implementa correctamente la interfaz XTypeProvider.&lt;br /&gt;
Implementando componentes de Python UNO.&lt;br /&gt;
&lt;br /&gt;
Existe un cargador de componentes a python. Esto permite crear instancias de clases de python no solo en el proceso de python pero en cual quialquier proceso arbitrario de UNO incluyendo OpenOffice.org. El cargador de python, carga el runtime de python bajo demanda en caso de no estar cargado y ejecutando codigo de python desde el interprete root de python.&lt;br /&gt;
&lt;br /&gt;
Si el lector no esta familiarizado con el proceso de registro de componentes, entonces se sugiere que vaya el maual de desarrollo de OpenOffice.org para una amplia explicación.&lt;br /&gt;
&lt;br /&gt;
El cargador de Python actualmente soporta los siguientes protocolos para urls recibidas:Nombre del Protocolo	Descripción&lt;br /&gt;
vnd.openoffice.pymodule	&lt;br /&gt;
El protocolo depende en parte interpretado por el nombre del modulo de python, el cual es importado usando el componente de importación comun en python (el cual usa la variable de ambiente de PYTHONPATH).&lt;br /&gt;
&lt;br /&gt;
Ejemplo. vnd.openoffice.pymodule:MyPythonComponent&lt;br /&gt;
&lt;br /&gt;
Usando esta url ej. en XLoader.activate() intentara correr al archivo MyPythonComponent.py desde los directorios, los cuales son listados dentro de la variable de ambiente PYTHONPATH. Toma nota que no debes usar el prefijo *.py en este caso.&lt;br /&gt;
&lt;br /&gt;
El modulo mostrado es agregado al mapeo de sys.modules.&lt;br /&gt;
file	&lt;br /&gt;
Obligatoriamente el url debe ser absoluto al archivo componente de python. El archivo mismo no necesita ser contenido en el PYTHONPATH, simplemente importar los archivos que estan contenidos en el PYTHONPATH. El modulo no es adherido al sys.modules.&lt;br /&gt;
&lt;br /&gt;
Ejemplo: file:///path/to/MyPythonComponent.py&lt;br /&gt;
vnd.sun.star.expand	&lt;br /&gt;
El cargador de python soporta el mecanismo de expansion de macros tal como los cargadores de Java y C++.&lt;br /&gt;
&lt;br /&gt;
Ejemplo: vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/MyPythonComponent.py&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Despues de que el modulo esta importado, el cargador de python busca una variable del modulo-global con el nombre g_ImplementationHelper el cual es esperado ser una intancia del unohelper.ImplementationHelper. El siguiente ejemplo hace que un componente de uno fuera de los objetsos UNO ( no es que el componente sea tan útil, por que en esta ocasion no existe un metodo UNO que reciba una tupla tampoco existe especificaci&amp;amp;ooacute;n de servicio com.sun.star.io.OutputStream, solo estan aquí como ejemplo. )&lt;br /&gt;
&amp;lt;code&amp;gt;[python]import unohelper&lt;br /&gt;
from com.sun.star.io import XOutputStream&lt;br /&gt;
&lt;br /&gt;
g_ImplementationHelper = unohelper.ImplementationHelper()&lt;br /&gt;
&lt;br /&gt;
class TupleOutputStream( unohelper.Base, XOutputStream ):&lt;br /&gt;
      # The component must have a ctor with the component context as argument.&lt;br /&gt;
      def __init__( self, ctx ):&lt;br /&gt;
  self.t = ()&lt;br /&gt;
  self.closed = 0&lt;br /&gt;
&lt;br /&gt;
      # idl void closeOutput();&lt;br /&gt;
      def closeOutput(self):&lt;br /&gt;
  self.closed = 1&lt;br /&gt;
&lt;br /&gt;
      # idl void writeBytes( [in] sequence seq );&lt;br /&gt;
      def writeBytes( self, seq ):&lt;br /&gt;
  self.t = self.t + seq      # simply add the incoming tuple to the member&lt;br /&gt;
&lt;br /&gt;
      # idl void flush();&lt;br /&gt;
      def flush( self ):&lt;br /&gt;
  pass&lt;br /&gt;
&lt;br /&gt;
      # convenience function to retrieve the tuple later (no UNO function, may&lt;br /&gt;
      # only be called from python )&lt;br /&gt;
      def getTuple( self ):&lt;br /&gt;
  return self.t&lt;br /&gt;
&lt;br /&gt;
# add the TupleOutputStream class to the implementation container,&lt;br /&gt;
# which the loader uses to register/instantiate the component.&lt;br /&gt;
g_ImplementationHelper.addImplementation( \&lt;br /&gt;
TupleOutputStream,&amp;quot;org.openoffice.pyuno.PythonOutputStream&amp;quot;,&lt;br /&gt;
                    (&amp;quot;com.sun.star.io.OutputStream&amp;quot;,),)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Asumamos, que este codigo es guardado en un archivo llamado tuplestrm.py y el archivo existe en algun lugar dentro de la variable PYTHONPATH, puede ser registrado al OO1beta construido del siguiente formato:&lt;br /&gt;
    regcomp -register -br types.rdb -br services.rdb -r services.rdb -c vnd.openoffice.pymodule:tuplestrm &lt;br /&gt;
&lt;br /&gt;
Claro que tambien puedes usar el pkgchk del tutorial en el capitulo&lt;br /&gt;
    pkgchk tuplestrm.py &lt;br /&gt;
&lt;br /&gt;
aunque este comando crea una copia del archivo (cuando el script cambia, debe ser reimplementado usando el comando que sigue. )&lt;br /&gt;
&lt;br /&gt;
Este componente puede ser llamado desde OpenOffice.org Basic con:&lt;br /&gt;
&amp;lt;code&amp;gt;[python]tupleStrm = createUnoService( &amp;quot;com.sun.star.io.OutputStream&amp;quot; )&lt;br /&gt;
tupleStrm.flush()&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Pyuno005.png&amp;diff=156852</id>
		<title>File:Pyuno005.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Pyuno005.png&amp;diff=156852"/>
		<updated>2010-02-10T06:58:38Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Pyuno004.png&amp;diff=156851</id>
		<title>File:Pyuno004.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Pyuno004.png&amp;diff=156851"/>
		<updated>2010-02-10T06:56:18Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Pyuno002.png&amp;diff=156440</id>
		<title>File:Pyuno002.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Pyuno002.png&amp;diff=156440"/>
		<updated>2010-02-06T06:51:53Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: uploaded a new version of &amp;quot;File:Pyuno002.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Pyuno003.png&amp;diff=156431</id>
		<title>File:Pyuno003.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Pyuno003.png&amp;diff=156431"/>
		<updated>2010-02-06T05:46:05Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Pyuno002.png&amp;diff=156430</id>
		<title>File:Pyuno002.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Pyuno002.png&amp;diff=156430"/>
		<updated>2010-02-06T05:45:44Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Pyuno001.png&amp;diff=156428</id>
		<title>File:Pyuno001.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Pyuno001.png&amp;diff=156428"/>
		<updated>2010-02-06T05:35:48Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=ES&amp;diff=156423</id>
		<title>ES</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=ES&amp;diff=156423"/>
		<updated>2010-02-06T05:13:50Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: /* OpenOffice.org Espa&amp;amp;ntilde;ol */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE: Wiki de OpenOffice.org Español}}&lt;br /&gt;
&lt;br /&gt;
[[image:Oooespanol.png]]&lt;br /&gt;
=== [[OpenOffice.org|OpenOffice.org]] Espa&amp;amp;ntilde;ol===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pagina de la comunidad en Espa&amp;amp;ntilde;ol&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #eff3ff;&amp;quot;&amp;gt;&lt;br /&gt;
Aprende como &amp;#039;&amp;#039;&amp;#039;[[OOoES/AyudaWiki |contribuir con el wiki]]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Bienvenido al wiki de OpenOffice.org==&lt;br /&gt;
Este wiki es para todos los proyectos asociados con OpenOffice.org (OOo). Es nuevo, por lo que esta enfocado principalmente a recursos para desarrolladores. Cuando se añadan otros proyectos, se listarán aquí. Haz clic sobre un enlace para ir a la página que quieras. &lt;br /&gt;
* [[OOoES/Desarrollo/Inicio|Desarrollo]] &lt;br /&gt;
* [[Marketing|Mercadeo (internacional)]]&lt;br /&gt;
* [[ES/Marketing|Mercadeo (en español)]]&lt;br /&gt;
* [[NLC|Confederación idioma nativo]]&lt;br /&gt;
* [[#Finding general OpenOffice.org user help|Recursos de usuario]]&lt;br /&gt;
* [[OOoES/Desarrollo/Aseguramiento de la calidad|Aseguramiento de la calidad]]&lt;br /&gt;
&lt;br /&gt;
Contribuye con el Wiki de OpenOffice.org. Por favor, usa tu login de OOo para la cuenta del wiki. Para evitar el spam, algunas funciones están disponibles solamente si estás registrado. Posiblemente más adelante seamos capaces de evitar la administración separada de usuarios y autenticarte con las credenciales del sitio de OpenOffice.org.&lt;br /&gt;
&lt;br /&gt;
Para iniciar la edición del wiki ve [[Help:Editing]].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:45%; float:right;&amp;quot;&amp;gt;&lt;br /&gt;
=== Traducciones ===&lt;br /&gt;
Traducciones de otras p&amp;amp;aacute;gina de proyectos dentro de OpenOffice.org donde la comunidad tiene participaci&amp;amp;oacute;n.&lt;br /&gt;
* [[OOoES/Traduccion/Localizacion_ES_30|Localizacion_ES]] Localización de OOo tanto el UI como la ayuda.&lt;br /&gt;
* Traducción de herramientas de localización:&lt;br /&gt;
** [[Traduccion_QA1]]&lt;br /&gt;
** [[Traduccion_TCM]]&lt;br /&gt;
** [[QATrack_ES]]&lt;br /&gt;
* [http://www.slideshare.net/jza/issue-tracker/|Issue Tracker] - presentaci&amp;amp;oacute;n de issue tracker.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:45%&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Proyectos ===&lt;br /&gt;
Iniciativas o proyectos dentro de la comunidad.&lt;br /&gt;
* Lista de tareas en las que pueden contribuir [[contribuciones_OOoES]].&lt;br /&gt;
* [[Comparativa_MSvsOOo| Comparativa de funcionalidad entre Microsoft Office y OpenOffice.org]]  &amp;#039;&amp;#039;&amp;#039;Nuevo&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [[Propuesta_estandarizacion | Plantilla de Propuesta de migraci&amp;amp;oacute;n hacia OpenDocument y OpenOffice.org]] &amp;#039;&amp;#039;&amp;#039;Nuevo&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [[TemarioCertificacionOOo | Temario de Certifcación de OpenOffice.org]]&lt;br /&gt;
* [[Desarrollo/Diccionarios | Diccionarios]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Varios===&lt;br /&gt;
* [[OOoES/Desarrollo/CSS |OOoES Styles]] of the [[OOoES]], CSS practices.&lt;br /&gt;
* [[API@OOo_ES]] Traduccion del volante de noticias del proyecto API&lt;br /&gt;
* [[Referencia Modulos]] Referencia a modulos de OpenOffice.org&lt;br /&gt;
* [[Tips OOo]] Aqui podras encontrar tips y recursos de como mejorar tu experiencia con OpenOffice.org&lt;br /&gt;
* [[ES_Documentacion | Documentaci&amp;amp;oacute;n]] Guia sobre como esta organizada la documentacion.&lt;br /&gt;
* [[OOo y Distros Linux]] Nexo entre OpenOffice.org y las principales distribuciones de Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:NLC]] [[Category:OOoES]]&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=ES&amp;diff=156422</id>
		<title>ES</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=ES&amp;diff=156422"/>
		<updated>2010-02-06T05:13:18Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: /* OpenOffice.org Espa&amp;amp;ntilde;ol */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE: Wiki de OpenOffice.org Español}}&lt;br /&gt;
&lt;br /&gt;
[[image:Oooespanol.png]]&lt;br /&gt;
=== [[OpenOffice|OpenOffice.org]] Espa&amp;amp;ntilde;ol===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pagina de la comunidad en Espa&amp;amp;ntilde;ol&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #eff3ff;&amp;quot;&amp;gt;&lt;br /&gt;
Aprende como &amp;#039;&amp;#039;&amp;#039;[[OOoES/AyudaWiki |contribuir con el wiki]]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Bienvenido al wiki de OpenOffice.org==&lt;br /&gt;
Este wiki es para todos los proyectos asociados con OpenOffice.org (OOo). Es nuevo, por lo que esta enfocado principalmente a recursos para desarrolladores. Cuando se añadan otros proyectos, se listarán aquí. Haz clic sobre un enlace para ir a la página que quieras. &lt;br /&gt;
* [[OOoES/Desarrollo/Inicio|Desarrollo]] &lt;br /&gt;
* [[Marketing|Mercadeo (internacional)]]&lt;br /&gt;
* [[ES/Marketing|Mercadeo (en español)]]&lt;br /&gt;
* [[NLC|Confederación idioma nativo]]&lt;br /&gt;
* [[#Finding general OpenOffice.org user help|Recursos de usuario]]&lt;br /&gt;
* [[OOoES/Desarrollo/Aseguramiento de la calidad|Aseguramiento de la calidad]]&lt;br /&gt;
&lt;br /&gt;
Contribuye con el Wiki de OpenOffice.org. Por favor, usa tu login de OOo para la cuenta del wiki. Para evitar el spam, algunas funciones están disponibles solamente si estás registrado. Posiblemente más adelante seamos capaces de evitar la administración separada de usuarios y autenticarte con las credenciales del sitio de OpenOffice.org.&lt;br /&gt;
&lt;br /&gt;
Para iniciar la edición del wiki ve [[Help:Editing]].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:45%; float:right;&amp;quot;&amp;gt;&lt;br /&gt;
=== Traducciones ===&lt;br /&gt;
Traducciones de otras p&amp;amp;aacute;gina de proyectos dentro de OpenOffice.org donde la comunidad tiene participaci&amp;amp;oacute;n.&lt;br /&gt;
* [[OOoES/Traduccion/Localizacion_ES_30|Localizacion_ES]] Localización de OOo tanto el UI como la ayuda.&lt;br /&gt;
* Traducción de herramientas de localización:&lt;br /&gt;
** [[Traduccion_QA1]]&lt;br /&gt;
** [[Traduccion_TCM]]&lt;br /&gt;
** [[QATrack_ES]]&lt;br /&gt;
* [http://www.slideshare.net/jza/issue-tracker/|Issue Tracker] - presentaci&amp;amp;oacute;n de issue tracker.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:45%&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Proyectos ===&lt;br /&gt;
Iniciativas o proyectos dentro de la comunidad.&lt;br /&gt;
* Lista de tareas en las que pueden contribuir [[contribuciones_OOoES]].&lt;br /&gt;
* [[Comparativa_MSvsOOo| Comparativa de funcionalidad entre Microsoft Office y OpenOffice.org]]  &amp;#039;&amp;#039;&amp;#039;Nuevo&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [[Propuesta_estandarizacion | Plantilla de Propuesta de migraci&amp;amp;oacute;n hacia OpenDocument y OpenOffice.org]] &amp;#039;&amp;#039;&amp;#039;Nuevo&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [[TemarioCertificacionOOo | Temario de Certifcación de OpenOffice.org]]&lt;br /&gt;
* [[Desarrollo/Diccionarios | Diccionarios]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Varios===&lt;br /&gt;
* [[OOoES/Desarrollo/CSS |OOoES Styles]] of the [[OOoES]], CSS practices.&lt;br /&gt;
* [[API@OOo_ES]] Traduccion del volante de noticias del proyecto API&lt;br /&gt;
* [[Referencia Modulos]] Referencia a modulos de OpenOffice.org&lt;br /&gt;
* [[Tips OOo]] Aqui podras encontrar tips y recursos de como mejorar tu experiencia con OpenOffice.org&lt;br /&gt;
* [[ES_Documentacion | Documentaci&amp;amp;oacute;n]] Guia sobre como esta organizada la documentacion.&lt;br /&gt;
* [[OOo y Distros Linux]] Nexo entre OpenOffice.org y las principales distribuciones de Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:NLC]] [[Category:OOoES]]&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=ES&amp;diff=156419</id>
		<title>ES</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=ES&amp;diff=156419"/>
		<updated>2010-02-06T05:07:01Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: /* Bienvenido al wiki de OpenOffice.org */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE: Wiki de OpenOffice.org Español}}&lt;br /&gt;
&lt;br /&gt;
[[image:Oooespanol.png]]&lt;br /&gt;
=== [[OpenOffice|OpenOffice]].org Espa&amp;amp;ntilde;ol===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pagina de la comunidad en Espa&amp;amp;ntilde;ol&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #eff3ff;&amp;quot;&amp;gt;&lt;br /&gt;
Aprende como &amp;#039;&amp;#039;&amp;#039;[[OOoES/AyudaWiki |contribuir con el wiki]]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Bienvenido al wiki de OpenOffice.org==&lt;br /&gt;
Este wiki es para todos los proyectos asociados con OpenOffice.org (OOo). Es nuevo, por lo que esta enfocado principalmente a recursos para desarrolladores. Cuando se añadan otros proyectos, se listarán aquí. Haz clic sobre un enlace para ir a la página que quieras. &lt;br /&gt;
* [[OOoES/Desarrollo/Inicio|Desarrollo]] &lt;br /&gt;
* [[Marketing|Mercadeo (internacional)]]&lt;br /&gt;
* [[ES/Marketing|Mercadeo (en español)]]&lt;br /&gt;
* [[NLC|Confederación idioma nativo]]&lt;br /&gt;
* [[#Finding general OpenOffice.org user help|Recursos de usuario]]&lt;br /&gt;
* [[OOoES/Desarrollo/Aseguramiento de la calidad|Aseguramiento de la calidad]]&lt;br /&gt;
&lt;br /&gt;
Contribuye con el Wiki de OpenOffice.org. Por favor, usa tu login de OOo para la cuenta del wiki. Para evitar el spam, algunas funciones están disponibles solamente si estás registrado. Posiblemente más adelante seamos capaces de evitar la administración separada de usuarios y autenticarte con las credenciales del sitio de OpenOffice.org.&lt;br /&gt;
&lt;br /&gt;
Para iniciar la edición del wiki ve [[Help:Editing]].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:45%; float:right;&amp;quot;&amp;gt;&lt;br /&gt;
=== Traducciones ===&lt;br /&gt;
Traducciones de otras p&amp;amp;aacute;gina de proyectos dentro de OpenOffice.org donde la comunidad tiene participaci&amp;amp;oacute;n.&lt;br /&gt;
* [[OOoES/Traduccion/Localizacion_ES_30|Localizacion_ES]] Localización de OOo tanto el UI como la ayuda.&lt;br /&gt;
* Traducción de herramientas de localización:&lt;br /&gt;
** [[Traduccion_QA1]]&lt;br /&gt;
** [[Traduccion_TCM]]&lt;br /&gt;
** [[QATrack_ES]]&lt;br /&gt;
* [http://www.slideshare.net/jza/issue-tracker/|Issue Tracker] - presentaci&amp;amp;oacute;n de issue tracker.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:45%&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Proyectos ===&lt;br /&gt;
Iniciativas o proyectos dentro de la comunidad.&lt;br /&gt;
* Lista de tareas en las que pueden contribuir [[contribuciones_OOoES]].&lt;br /&gt;
* [[Comparativa_MSvsOOo| Comparativa de funcionalidad entre Microsoft Office y OpenOffice.org]]  &amp;#039;&amp;#039;&amp;#039;Nuevo&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [[Propuesta_estandarizacion | Plantilla de Propuesta de migraci&amp;amp;oacute;n hacia OpenDocument y OpenOffice.org]] &amp;#039;&amp;#039;&amp;#039;Nuevo&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [[TemarioCertificacionOOo | Temario de Certifcación de OpenOffice.org]]&lt;br /&gt;
* [[Desarrollo/Diccionarios | Diccionarios]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Varios===&lt;br /&gt;
* [[OOoES/Desarrollo/CSS |OOoES Styles]] of the [[OOoES]], CSS practices.&lt;br /&gt;
* [[API@OOo_ES]] Traduccion del volante de noticias del proyecto API&lt;br /&gt;
* [[Referencia Modulos]] Referencia a modulos de OpenOffice.org&lt;br /&gt;
* [[Tips OOo]] Aqui podras encontrar tips y recursos de como mejorar tu experiencia con OpenOffice.org&lt;br /&gt;
* [[ES_Documentacion | Documentaci&amp;amp;oacute;n]] Guia sobre como esta organizada la documentacion.&lt;br /&gt;
* [[OOo y Distros Linux]] Nexo entre OpenOffice.org y las principales distribuciones de Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:NLC]] [[Category:OOoES]]&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=OOoES/Desarrollo/PyUNO_ES_bak&amp;diff=156405</id>
		<title>OOoES/Desarrollo/PyUNO ES bak</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=OOoES/Desarrollo/PyUNO_ES_bak&amp;diff=156405"/>
		<updated>2010-02-06T02:40:26Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: Created page with &amp;#039;== El conector de Python-Uno == Traducido por: Alexandro Colorado  === Introducción === El conector de python-Uno o PyUno te permite usar el API estandard de OpenOffice.org desd…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== El conector de Python-Uno ==&lt;br /&gt;
Traducido por: Alexandro Colorado&lt;br /&gt;
&lt;br /&gt;
=== Introducción ===&lt;br /&gt;
El conector de python-Uno o PyUno te permite usar el API estandard de OpenOffice.org desde el tan bien conocido lenguaje llamado python. Tambié te permite desarrollar componentes en python, aunque los componentes de PyUno pueden ser corridos durante el proceso dentro de la suite, este tambien puede ser conjugado desde Java, C++ o ser construido desde el lenguaje StarBasic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
La versión original de este documento lo puedes encontrar en http://udk.openoffice.org/python/python-bridge.html&lt;br /&gt;
&lt;br /&gt;
=== Descargas ===&lt;br /&gt;
&lt;br /&gt;
Puedes descargar esta documentaci&amp;amp;oacuten incluyendo sus ejemplos y archivos de apoyo para este nuevo modo de trabajo basado en scripting para trabajos no en linea.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Descarga pyuno-docs.zip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Estado ===&lt;br /&gt;
El conector de PyUno esta completado, pero no ha sido empleado por suficiente gente, así que puede contener algunos errores. Ahora esta integrado a la fuente de OpenOffice.org 1.1. Aunque no corre con el la fuente de las versiones 1.0 para atras.&lt;br /&gt;
&lt;br /&gt;
Actualmente la documentación esta enfocada a desarrolladores, que cuentan con la suficiente experiencia en el API nativo de OpenOffice.org y que lo han usado bajo otro lenguaje(Java/C++/StarBasic). Si eres un novato y sientes que alguna información es requerida, te sugerimos buscarla en la &amp;quot;La Guía del Desarrollador&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== El Tutorial PyUno para OpenOffice.org ===&lt;br /&gt;
En este tutorial, mostramos como se puede usar el conector PyUNO para automatizar tareas dentro de OpenOffice.org. Este documento no es un tutorial de OpenOffice.org existen ya muchos documentos enfocados a esta actividad. A continuación mostraremos los pasos a seguir dentro de PyUNO&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Instalación de PyUNO ====&lt;br /&gt;
Desde la versión OpenOffice.org 1.1 RC4 para arriba, PyUNO es incluido en la instalación por default. Si tienes una versió anterior a esta puedes saltar el proximo parrafo.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Al Usar OpenOffice.org 1.1RC3 o antes, el conector de PyUNO debe ser seleccionado manualmente para su instalación. Escoga entonces la instalación personalizada.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
y activa el conector de Python-Uno en los componentes opcionales&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Tambien puedes instalar PyUNO despues de la instalación inicial, corriendo la instalación de OpenOffice.org sombre si misa y seleccionando Modificar en el siguiente dialogo.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nota: Cuando inicias el script de comienzo (eg. install --prefix=/usr/local) para instalación, solo puedes comenzar python despues de la instalación, solo puedes instalar pyuno despues de haber ejecutado el script setup /net y escogido Modify. Nota, que OOo Rc2 el cual no instala dos archivos ini como deviera.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Modo del conector PyUNO ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PyUNO puede usar dos metodologías diferentes:&lt;br /&gt;
Dentro del ejecutable de Python(y fuera del proceso de OpenOffice.org).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usa esta metodología cuando: &lt;br /&gt;
Comienzes a usar python (tiene un enfoque mas intuitivo.&lt;br /&gt;
quieres apuntar a ejecuciones del script comenzando procesos separados (ie. cgi-script dentro de un http-server.&lt;br /&gt;
Quieres un retorno rapido de codigo-ejecución codigo-ejecución.&lt;br /&gt;
&lt;br /&gt;
   Hola Mundo&lt;br /&gt;
&lt;br /&gt;
Asegurate, de que OOo no este corriendo(cierra el QuickStarter tambien). Activa una terminal ya sea cmd en WinNT+, command en Win9x o bash en *nix. Ve al directorio donde reside el programa de OpenOffice.org y activa OOo con los siguientes parametros.&lt;br /&gt;
:\Program Files\OpenOffice1.1\program&amp;gt;  soffice &amp;quot;-accept=socket,host=localhost,port=2002;urp;&amp;quot; &lt;br /&gt;
&lt;br /&gt;
Ahora comienza el archivo hello_world.py con tu editor de texto favorito e incluye el siguiente codigo.&lt;br /&gt;
&amp;lt;code&amp;gt;[python] import uno&lt;br /&gt;
&lt;br /&gt;
# get the uno component context from the PyUNO runtime&lt;br /&gt;
localContext = uno.getComponentContext()&lt;br /&gt;
&lt;br /&gt;
# create the UnoUrlResolver &lt;br /&gt;
resolver = localContext.ServiceManager.createInstanceWithContext(&lt;br /&gt;
&amp;quot;com.sun.star.bridge.UnoUrlResolver&amp;quot;, localContext )&lt;br /&gt;
&lt;br /&gt;
# connect to the running office &lt;br /&gt;
ctx = resolver.resolve( &amp;quot;uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext&amp;quot; )&lt;br /&gt;
smgr = ctx.ServiceManager&lt;br /&gt;
&lt;br /&gt;
# get the central desktop object&lt;br /&gt;
desktop = smgr.createInstanceWithContext( &amp;quot;com.sun.star.frame.Desktop&amp;quot;,ctx)&lt;br /&gt;
&lt;br /&gt;
# access the current writer document&lt;br /&gt;
model = desktop.getCurrentComponent()&lt;br /&gt;
&lt;br /&gt;
# access the document&amp;#039;s text property&lt;br /&gt;
text = model.Text&lt;br /&gt;
&lt;br /&gt;
# create a cursor&lt;br /&gt;
cursor = text.createTextCursor()&lt;br /&gt;
&lt;br /&gt;
# insert the text into the document&lt;br /&gt;
text.insertString( cursor, &amp;quot;Hello World&amp;quot;, 0 )&lt;br /&gt;
&lt;br /&gt;
# Do a nasty thing before exiting the python process. In case the&lt;br /&gt;
# last call is a oneway call (e.g. see idl-spec of insertString),&lt;br /&gt;
# it must be forced out of the remote-bridge caches before python&lt;br /&gt;
# exits the process. Otherwise, the oneway call may or may not reach&lt;br /&gt;
# the target object.&lt;br /&gt;
# I do this here by calling a cheap synchronous call (getPropertyValue).&lt;br /&gt;
ctx.ServiceManager&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ejecuta el script pasado con el siguiente comando&lt;br /&gt;
   c:\Program Files\OpenOffice1.1\program&amp;gt; .\python hello_world.py &lt;br /&gt;
&lt;br /&gt;
Este script escribe la cadena Hello World dentro del documento OpenWriter&lt;br /&gt;
&lt;br /&gt;
==== Dentro del proceso de OpenOffice.org ====&lt;br /&gt;
 &lt;br /&gt;
Usa este modo cuando:&lt;br /&gt;
* Quieras facilmente ejecutar tu codigo en multiples maquinas&lt;br /&gt;
* Tu codigo sea necesitado por llamadas de otros programas&lt;br /&gt;
* Tienes mas experiencia con el funcionamiento de PyUNO.&lt;br /&gt;
* Quieres que tu codigo corra con el mejor desempeño&lt;br /&gt;
Hola Mundo&lt;br /&gt;
&lt;br /&gt;
El ejemplo siguiente esta guardado como un componente de UNO, esto significa, que el codigo que ejecuta la insersion necesita ser embedido en una class de python. Aparte, el codigo-de-conexion a la suite necesita ser remplazado por un punto clave, el cual usa el cargador de python para iniciar una clase de python.&lt;br /&gt;
hello_world.py&lt;br /&gt;
&amp;lt;code&amp;gt;[python]import uno&lt;br /&gt;
import unohelper&lt;br /&gt;
&lt;br /&gt;
from com.sun.star.task import XJobExecutor&lt;br /&gt;
&lt;br /&gt;
# implement a UNO component by deriving from the standard unohelper.Base class&lt;br /&gt;
# and from the interface(s) you want to implement.&lt;br /&gt;
class HelloWorldJob( unohelper.Base, XJobExecutor ):&lt;br /&gt;
    def __init__( self, ctx ):&lt;br /&gt;
        # store the component context for later use&lt;br /&gt;
        self.ctx = ctx&lt;br /&gt;
        &lt;br /&gt;
    def trigger( self, args ):&lt;br /&gt;
        # note: args[0] == &amp;quot;HelloWorld&amp;quot;, see below config settings&lt;br /&gt;
    &lt;br /&gt;
        # retrieve the desktop object&lt;br /&gt;
        desktop = self.ctx.ServiceManager.createInstanceWithContext(&lt;br /&gt;
            &amp;quot;com.sun.star.frame.Desktop&amp;quot;, self.ctx )&lt;br /&gt;
    &lt;br /&gt;
        # get current document model&lt;br /&gt;
        model = desktop.getCurrentComponent()&lt;br /&gt;
&lt;br /&gt;
        # access the document&amp;#039;s text property&lt;br /&gt;
        text = model.Text&lt;br /&gt;
&lt;br /&gt;
        # create a cursor&lt;br /&gt;
        cursor = text.createTextCursor()&lt;br /&gt;
&lt;br /&gt;
        # insert the text into the document&lt;br /&gt;
        text.insertString( cursor, &amp;quot;Hello World&amp;quot;, 0 )&lt;br /&gt;
&lt;br /&gt;
# pythonloader looks for a static g_ImplementationHelper variable&lt;br /&gt;
g_ImplementationHelper = unohelper.ImplementationHelper()&lt;br /&gt;
&lt;br /&gt;
# &lt;br /&gt;
g_ImplementationHelper.addImplementation( \&lt;br /&gt;
        HelloWorldJob,                        # UNO object class&lt;br /&gt;
        &amp;quot;org.openoffice.comp.pyuno.demo.HelloWorld&amp;quot;, # implemenation name&lt;br /&gt;
                                      # Change this name for your own&lt;br /&gt;
      # script &lt;br /&gt;
        (&amp;quot;com.sun.star.task.Job&amp;quot;,),)          # list of implemented services&lt;br /&gt;
                                      # (the only service)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
El codigo necesita ser enlazado a un evento. Esto puede hacerce configurando estas opciones.&lt;br /&gt;
Addons.xcu: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Both files must be packaged up into a single zip file by using your favourite zip utility, e.g. infozip&lt;br /&gt;
&amp;lt;code&amp;gt;[bash]zip hello_world.zip Addons.xcu hello_world_comp.py&lt;br /&gt;
  adding: Addons.xcu (deflated 55%)&lt;br /&gt;
  adding: hello_world_comp.py (deflated 55%)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Estos paquetes pueden ser implementados dentro de una instalación de OpenOffice.org usando la herramienta &lt;br /&gt;
pkgchk&lt;br /&gt;
, el cual esta ubicada en el directorio de program dentro de OOo. Se advierte que OOo debe de estar completamente cerrado. &lt;br /&gt;
  c:\Program Files\OpenOffice.org1.1\program&amp;gt; pkgchk hello_world.zip&lt;br /&gt;
  c:\Program Files\OpenOffice.org1.1\program&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Si el proceso se realiza con exito, no tendras ningun reotorno de la herramienta. Y cuando comienzes de nuevo OOo, encontraras una nueva entrada del menu (ver Tools / Aditional Components / Insert Hello World).&lt;br /&gt;
&lt;br /&gt;
Como puedes ver las lineas de los scripts bases son identicas, pero la forma para extraer los componentes de office difieren.&lt;br /&gt;
Ejemplos&lt;br /&gt;
* ooextract.py- Una herramienta de linea de comando la cual extrae el contenido de un archivo creado con OpenOffice.org en un modo stout.&lt;br /&gt;
* swriter.py- Herramienta de linea de comando la cual crea y llena un documento de Writer con cierto texto y tablas con formato.&lt;br /&gt;
* swritercomp.py y swritercompclient.pyIgual que la anterior pero esta esta en modo componente UNO, asi que corre dentro de OpenOffice.org. Uno puede ver la mejora en el desempeño corriendo el componente como un proceso.&lt;br /&gt;
biblioaccess.py- Herramienta de linea de comando, que presenta el contenido del la base de datos, biblio, que incluye OpenOffice.org&lt;br /&gt;
&lt;br /&gt;
=== Conexión al lenguaje UNO ===&lt;br /&gt;
&lt;br /&gt;
A continuación encontrarás la completa descripción de las herramientas UNO se conectan con el lenguaje de Python.&lt;br /&gt;
El typo de mapeo UNOEl tipo de dato IDL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
tipos de enteros (byte, short, unsigned long, hyper, unsigned hyper	Representación en Python&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python solo conoce los datatypes encontrados en C long y long long como tipos de enteros. En la mayor parte de las maquinas, un long es un valor de 32 bit mientras long long es de 64 bits.&lt;br /&gt;
* Valores de UNO (por ejemplo, retorno del valor de un metodo UNO)&lt;br /&gt;
* Valores que tiene los tipos byte, short, unsigned short, long o unsigned, long son convertidos a un valor python long. &lt;br /&gt;
* Valores que tienen un tipo de hyper u unsigned hyper son convertidos a python como long long.&lt;br /&gt;
* Valores enviados a UNO (por ejemplo, el argumento de un metodo UNO)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Si hay un tipo concreto en el metodo IDL, el valor es convertido a un tipo concreto (de hecho el servicio de invoación hace este trabajo). Si el metodo solo contiene un any, cada valor del entero será convertido al typo de dato mas pequeño, donde el valor se ajusta y lo manda al objeto UNO (así que 5 se convierte en un byte, 150 se vuelve short, 0x1f023 un long y los valores mayores a 0xffffffff se convierten en un hyper.&lt;br /&gt;
boolean	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python tiene, internamente un datatype buleano, el cual es derivado del tipo de entero (ver http://python.org/peps/pep-0285.html ). Ahí existe el True y False, el cual PyUNO usa para distinguir entre valores integrales o buleanos.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mientras el buleano sea especificado en el metodo de interfaz, podrás seguir usando numeros. En los ejemplos siguientes, todas las llamadas son validas:&lt;br /&gt;
&amp;lt;code&amp;gt;[python]#idl signature void takeBool( [in] boolean bool )&lt;br /&gt;
unoObject.takeBool( 1 ) # valid, passing true (PyUNO runtime&lt;br /&gt;
# does the conversion&lt;br /&gt;
unoObject.takeBool( True) ) # valid, passing true&lt;br /&gt;
unoObject.takeBool( False ) # valid, passing false&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Si embargo, cuando quieres especificamente pasar un buleano, cuando solo any es especificado, tu debes usar True y False.&lt;br /&gt;
idl signature void foo( [in] any value )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[python]# implementation expects a boolean (which is separately documented&lt;br /&gt;
# e.g. in the service specification.&lt;br /&gt;
unoObject.foo( True ) # valid, pass a true&lt;br /&gt;
unoObject.foo( 1 )    # bad, just passing a 1, implementation will&lt;br /&gt;
                      # probably not be able to deal with it correctly.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nota: Tambien existe el uso de la clase uno.Bool, el cual es no es usado desde pyuno 0.9.2 aunque se sigue soportando. Ya no lo usen.&lt;br /&gt;
string	En general, la cadena esta mapeada dentro de la cadena-unicodigo de python. Sin embargo, quizas pases una cadena de 8-bits cuando se espere una cade de UNO, el conector convierte los 8-bits a una cadena-unicodigo usando el locale del sistema. &lt;br /&gt;
&amp;lt;code&amp;gt;[python]# idl signatore foo( [in] string value )&lt;br /&gt;
# both lines are valid&lt;br /&gt;
unoObject.foo( u&amp;#039;my foo string&amp;#039; )&lt;br /&gt;
unoObject.foo( &amp;#039;my foo string&amp;#039; )&lt;br /&gt;
char	Un char es mapeado a un uno.Char. Tiene el miembro de una cadena-unicodigo publico con lenght 1 como contenedor del char unicodigo. &lt;br /&gt;
# idl signature foo( [in] char c)&lt;br /&gt;
unoObject.foo( uno.Char( u&amp;#039;h&amp;#039; ) )  #valid&lt;br /&gt;
unoObject.foo( &amp;#039;h&amp;#039; )               #wrong&lt;br /&gt;
	  &lt;br /&gt;
enum	&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Un valor enum es representado concretamente por una instancia de la clase uno.Enum. Tiene dos miembros, typeName es una string conteniendo el nombre del tipo enum y value contiene el valor de enum.&lt;br /&gt;
&lt;br /&gt;
Puedes concretar los valores de enum de dos formas:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.(suggested) by importing&lt;br /&gt;
  from enumname import enumvalue. &lt;br /&gt;
&lt;br /&gt;
E.g. &lt;br /&gt;
[code]from com.sun.star.uno.TypeClass import UNSIGNED_LONG&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
unoObject.setValue( UNSIGNED_LONG )&lt;br /&gt;
if unoObject.getValue() == UNSIGNED_LONG:[/code]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.(in rare situations)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[python]import uno&lt;br /&gt;
     &lt;br /&gt;
unoObject.setValue( uno.Enum( &amp;quot;com.sun.star.uno.TypeClass&amp;quot;, &amp;quot;UNSIGNED_LONG&amp;quot;) )&lt;br /&gt;
if unoObject.getValue() == uno.Enum( &amp;quot;com.sun.star.uno.TypeClass&amp;quot;, &amp;quot;UNSIGNED_LONG&amp;quot;):&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
La primera soluci&amp;amp;ooacute;n tiene la ventaja de que en caso de el fallo en enum manda una RunTimeException o excepción del tiempo de proceso al momento que la fuente de python es importada.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;type	&amp;#039;&amp;#039;&lt;br /&gt;
Un tipo se mapea a uno.type . Tiene miembros publicos llamados typeName (cadenas) y typeClass (el valor enum de com.sun.star.uno.TypeClass). Ahi existe una función uno.getTypeByName() para facilmente crear una instancia de type, las funciones crean un RunTimeException en caso que el type no se conosca.&lt;br /&gt;
&lt;br /&gt;
Puedes crear valores concretos de dos formas:&lt;br /&gt;
1. from module-where-type-lives-in import typeOfTypeName. &lt;br /&gt;
&lt;br /&gt;
E.g. to create XComponent&amp;#039;s type, use &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
from com.sun.star.lang import typeOfXComponent&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
unoObject.setType( typeOfXComponent )&lt;br /&gt;
if unoObject.getType() == typeOfXComponent:	  &lt;br /&gt;
&lt;br /&gt;
2.(in rare situations, e.g. for types of simple values)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[python]&lt;br /&gt;
import uno&lt;br /&gt;
     &lt;br /&gt;
unoObject.setType( uno.getTypeByName( &amp;quot;com.sun.star.uno.XComponent&amp;quot; ) )&lt;br /&gt;
if unoObject.getType() == uno.getTypeByName( &amp;quot;com.sun.star.uno.XComponent&amp;quot;):&lt;br /&gt;
struct (and exception)	&amp;lt;/code&amp;gt;&lt;br /&gt;
Para cada uno struct (o excepción), una nueva clase de python es generada al vuelo. La clase generada refleja la jerarquia heredada del tipo UNO (es importante para el administrador de excepciones, ver abajo).&lt;br /&gt;
&lt;br /&gt;
Uno puede generar una clase struct usando el mecanismo de importación. Una instanacia del struct puede entonces ser instanciada usando el constructor de python. El constructor soporta el argumento cero (miembros obtienen el constructor default), 1 argumento con el mismo tipo (copia el constructor), y n argumentos, donde n es el nombre de elementos que contiene el struct. El struct soporta el operador de equality, dos struct son iguales, si son del mismo type y cada miembro es igual.&lt;br /&gt;
&lt;br /&gt;
Ejemplo.&lt;br /&gt;
&amp;lt;code&amp;gt;[python]&lt;br /&gt;
from com.sun.star.beans import PropertyValue&lt;br /&gt;
from com.sun.star.uno import Exception,RuntimeException&lt;br /&gt;
&lt;br /&gt;
propVal = PropertyValue()                 # Default constructor&lt;br /&gt;
propVal.Name = &amp;quot;foo&amp;quot;&lt;br /&gt;
propVal.Value = 2&lt;br /&gt;
&lt;br /&gt;
if propVal == PropertyValue( &amp;quot;foo&amp;quot;, 2 ):  # Memberwise constructor&lt;br /&gt;
   # true !&lt;br /&gt;
   pass&lt;br /&gt;
&lt;br /&gt;
if propVal == PropertyValue( propVal ):   # Copy Constructor&lt;br /&gt;
   # true &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Una instancia del struct UNO puede ser inicialmente construida de la función uno.createUnoStruct() y pasando el nombre de la struct como el primer parametro y el argumento opcional del constructor (ver arriba para un ejemplo de un posible ctors).&lt;br /&gt;
&lt;br /&gt;
ATENCION: En UNO, struct tiene el valor semantico, sin embargo, la manera como se maneja en python no refleja esto. Cuando el struct es pasado de un parametro a una funcion, el valor es pasado la funcion llamada. Las siguientes modificaciones a la instancia de la struct no afectaran a la funcion llamada. Sin embargo, la simple asignaci&amp;amp;oactue;n de una struct a otra variable local no crea una copia, simplemente crea un alias de la instancia original.&lt;br /&gt;
&amp;lt;code&amp;gt;[python]&lt;br /&gt;
struct = uno.createUnoStruct( &amp;quot;com.sun.star.beans.PropertyValue&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
struct.Name = &amp;quot;foo&amp;quot;&lt;br /&gt;
struct2 = struct&lt;br /&gt;
struct2.Name = &amp;quot;python&amp;quot;           # modifies also struct, probably not desired !&lt;br /&gt;
unoObject.call( struct, struct2 ) # passes the same struct 2 times !&lt;br /&gt;
&lt;br /&gt;
struct.Name = &amp;quot;doobidooo&amp;quot;         # even worse style. If the UNO object is implemented&lt;br /&gt;
                                  # in python, you possibly modify the callee&amp;#039;s value.&lt;br /&gt;
  # Don&amp;#039;t do this !&lt;br /&gt;
sequence	&amp;lt;/code&amp;gt;&lt;br /&gt;
Una secuencia generalmente esta trazada a una tupla de python. Una lista de de python (!) no es aceptada.&lt;br /&gt;
&amp;lt;code&amp;gt;[python]# idl signature XInterface createInstanceWithArguments(&lt;br /&gt;
#                        [in] string servicename,  [in] sequence  )&lt;br /&gt;
doc = smgr.createInstanceWithArguments( &amp;quot;foo.service&amp;quot;, (&amp;quot;arg1&amp;quot;,2))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Atención desde la version 0.9.2 El idl sequence&amp;lt;byte&amp;gt; es trazado a la clase uno.ByteSquence. Tiene un miembro cadena llamado value, el cual contiene los datos de la secuencia de byte. Tal como la bytesequence es generalmente un contenedor para datos binarios, esta clase permite manejar binarios eficientemente. Esto tambien embede pyuno a python, ya que python mantiene datos binarios en cadenas.&lt;br /&gt;
&amp;lt;code&amp;gt;[python]# idl signature writeBytes( [in] sequence%lt; byte &amp;gt; data )&lt;br /&gt;
#&lt;br /&gt;
out.writeBytes( uno.ByteSequence( &amp;quot;abc&amp;quot; ) )&lt;br /&gt;
&lt;br /&gt;
# you could also write the following&lt;br /&gt;
begin = uno.ByteSequence( &amp;quot;ab&amp;quot; )&lt;br /&gt;
out.writeBytes( begin + &amp;quot;c&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
# but this does not work !&lt;br /&gt;
out.writeBytes( &amp;quot;abc&amp;quot; ) # ERROR, no implict conversion supported by the runtime !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# idl signature long readBytes( [out] sequence , [in] length )&lt;br /&gt;
len,seq = in.readBytes( dummy, 3 )&lt;br /&gt;
&lt;br /&gt;
# the statements do the same thing &lt;br /&gt;
print seq == &amp;quot;abc&amp;quot;:&lt;br /&gt;
print seq == uno.ByteSequence( &amp;quot;abc&amp;quot; )&lt;br /&gt;
constants	&amp;lt;/code&amp;gt;&lt;br /&gt;
Una constante UNO idl puede ser dada por diferentes maneras:&lt;br /&gt;
Usa el valor concreto especificado en el archivo idl&lt;br /&gt;
Una constante es su valor y solo su valor. Ya que las modificaciones de los valores de la contacia es incompatible.&lt;br /&gt;
Usa el mecanismo de importación para crear variables con un nombre constante&lt;br /&gt;
La solución es la mas leida.&lt;br /&gt;
Usauno.getConstatByName()&lt;br /&gt;
puede ser util de vez en cuando. Las funciones RunTimeException se ejecutan en caso que la constante sea desconocida. &lt;br /&gt;
&amp;lt;code&amp;gt;[python]from com.sun.star.beans.PropertyConcept import ATTRIBUTES&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# the following 3 lines are equivalent&lt;br /&gt;
unoObject.setConcept( ATTRIBUTES )&lt;br /&gt;
unoObject.setConcept( 4 )&lt;br /&gt;
unoObject.setConcept( uno.getConstantByName( &amp;quot;com.sun.star.beans.PropertyConcept.ATTRIBUTES&amp;quot; ) )&lt;br /&gt;
any	&amp;lt;/code&amp;gt;&lt;br /&gt;
En general el programador en python nunca llega a tener contacto con anys. Si alguna vez saliera any en un metodo, el programador puede tan solo pasar un valor concreto. Consecuentemente, los retornos de valores o parametros tambien nunca contiene un any concreto.&lt;br /&gt;
&lt;br /&gt;
Sin embargo, hay ciertas circumstancias, donde el programdor de python quiera pasar un valor type concreto a una funcion que llame (nota, esto es solo posible para llamadas del &amp;#039;conector&amp;#039;, no puedes pasar un valor de type a ningun otro objeto python-uno).&lt;br /&gt;
&lt;br /&gt;
Puedes crear un uno.Any( ), pasando el type ( como typename o como uno.Type) y su valor.&lt;br /&gt;
&amp;lt;code&amp;gt;[python]# constructs a uno.Any, that contains a byte&lt;br /&gt;
byteAny = uno.Any( &amp;quot;byte&amp;quot; , 5 )&lt;br /&gt;
&lt;br /&gt;
# constructs a sequences of shorts&lt;br /&gt;
byteAny = uno.Any( &amp;quot;[]short&amp;quot;, (4,5))&amp;lt;/code&amp;gt;&lt;br /&gt;
	  &lt;br /&gt;
&lt;br /&gt;
Estas anys solo pueden ser usadas junto con el uno.invoke, el cual permite invocar un metodo dentro de un objeto arbitrario con un type any.&lt;br /&gt;
&amp;lt;code&amp;gt;[python]# the normal call&lt;br /&gt;
uno.setPropertyValue( &amp;quot;foo&amp;quot;, (4,5))&lt;br /&gt;
&lt;br /&gt;
# the uno.invoke call&lt;br /&gt;
uno.invoke( obj, &amp;quot;setPropertyValue&amp;quot; , (&amp;quot;foo&amp;quot;,uno.Any( &amp;quot;[]short&amp;quot;, (4,5))) )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cuando obj es un objeto conectado, la funcion que se llama obtiene la secuencia como una sequence(short). Cuando obj es un objeto local de python, solo obtiene el (4,5) como si lo hubiera obtenido con la llamada normal.&lt;br /&gt;
&lt;br /&gt;
=== Implementando los objetos UNO ===&lt;br /&gt;
Podras usar clases de python para implementar los objetos UNO. Instancias de python pueden ser pasadas como argumentos a llamados de UNO donde los anys o interfaces concretas hayan sido especificadas.&lt;br /&gt;
&lt;br /&gt;
Para ser un objeto UNO, una clase de python DEBE implementar la interface com.sun.star.lang.XTypeProvider implementando los metodos getTypes() y getImplementationID(), el cual informa el bridge de python, sobre cual UNO concreta la interfaz con la clase que implementa python. La funci&amp;amp;ooacute;n de getTypes() define que interfaz son definidas por las clases.&lt;br /&gt;
&lt;br /&gt;
Para hacer esto mas fácil, existe una clase unohelper.Base, donde uno objeto UNO de python se originara de el. Tu puedes entonces implementar una interfaz UNO simpmente originandolo de la interfaz preferida. El siguiente ejemplo implementa la interfaz com.sun.star.lang.XTypeProvider, el cual almacena toda la información escrita en el espacion de una ByteSequence(). (Nota: esta implementació es bastante pobre y es solo con propositos de demostración.&lt;br /&gt;
&amp;lt;code&amp;gt;[python]import unohelper&lt;br /&gt;
from com.sun.star.io import XOutputStream&lt;br /&gt;
class SequenceOutputStream( unohelper.Base, XOutputStream ):&lt;br /&gt;
      def __init__( self ):&lt;br /&gt;
          self.s = uno.ByteSequence(&amp;quot;&amp;quot;)&lt;br /&gt;
          self.closed = 0&lt;br /&gt;
          &lt;br /&gt;
      def closeOutput(self):&lt;br /&gt;
          self.closed = 1&lt;br /&gt;
&lt;br /&gt;
      def writeBytes( self, seq ):&lt;br /&gt;
          self.s = self.s + seq&lt;br /&gt;
&lt;br /&gt;
      def flush( self ):&lt;br /&gt;
          pass&lt;br /&gt;
&lt;br /&gt;
      def getSequence( self ):&lt;br /&gt;
          return self.s&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Desde la lista de clases bases, la implementación unohelper.Base implementa correctamente la interfaz XTypeProvider.&lt;br /&gt;
Implementando componentes de Python UNO.&lt;br /&gt;
&lt;br /&gt;
Existe un cargador de componentes a python. Esto permite crear instancias de clases de python no solo en el proceso de python pero en cual quialquier proceso arbitrario de UNO incluyendo OpenOffice.org. El cargador de python, carga el runtime de python bajo demanda en caso de no estar cargado y ejecutando codigo de python desde el interprete root de python.&lt;br /&gt;
&lt;br /&gt;
Si el lector no esta familiarizado con el proceso de registro de componentes, entonces se sugiere que vaya el maual de desarrollo de OpenOffice.org para una amplia explicación.&lt;br /&gt;
&lt;br /&gt;
El cargador de Python actualmente soporta los siguientes protocolos para urls recibidas:Nombre del Protocolo	Descripción&lt;br /&gt;
vnd.openoffice.pymodule	&lt;br /&gt;
El protocolo depende en parte interpretado por el nombre del modulo de python, el cual es importado usando el componente de importación comun en python (el cual usa la variable de ambiente de PYTHONPATH).&lt;br /&gt;
&lt;br /&gt;
Ejemplo. vnd.openoffice.pymodule:MyPythonComponent&lt;br /&gt;
&lt;br /&gt;
Usando esta url ej. en XLoader.activate() intentara correr al archivo MyPythonComponent.py desde los directorios, los cuales son listados dentro de la variable de ambiente PYTHONPATH. Toma nota que no debes usar el prefijo *.py en este caso.&lt;br /&gt;
&lt;br /&gt;
El modulo mostrado es agregado al mapeo de sys.modules.&lt;br /&gt;
file	&lt;br /&gt;
Obligatoriamente el url debe ser absoluto al archivo componente de python. El archivo mismo no necesita ser contenido en el PYTHONPATH, simplemente importar los archivos que estan contenidos en el PYTHONPATH. El modulo no es adherido al sys.modules.&lt;br /&gt;
&lt;br /&gt;
Ejemplo: file:///path/to/MyPythonComponent.py&lt;br /&gt;
vnd.sun.star.expand	&lt;br /&gt;
El cargador de python soporta el mecanismo de expansion de macros tal como los cargadores de Java y C++.&lt;br /&gt;
&lt;br /&gt;
Ejemplo: vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/MyPythonComponent.py&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Despues de que el modulo esta importado, el cargador de python busca una variable del modulo-global con el nombre g_ImplementationHelper el cual es esperado ser una intancia del unohelper.ImplementationHelper. El siguiente ejemplo hace que un componente de uno fuera de los objetsos UNO ( no es que el componente sea tan útil, por que en esta ocasion no existe un metodo UNO que reciba una tupla tampoco existe especificaci&amp;amp;ooacute;n de servicio com.sun.star.io.OutputStream, solo estan aquí como ejemplo. )&lt;br /&gt;
&amp;lt;code&amp;gt;[python]import unohelper&lt;br /&gt;
from com.sun.star.io import XOutputStream&lt;br /&gt;
&lt;br /&gt;
g_ImplementationHelper = unohelper.ImplementationHelper()&lt;br /&gt;
&lt;br /&gt;
class TupleOutputStream( unohelper.Base, XOutputStream ):&lt;br /&gt;
      # The component must have a ctor with the component context as argument.&lt;br /&gt;
      def __init__( self, ctx ):&lt;br /&gt;
  self.t = ()&lt;br /&gt;
  self.closed = 0&lt;br /&gt;
&lt;br /&gt;
      # idl void closeOutput();&lt;br /&gt;
      def closeOutput(self):&lt;br /&gt;
  self.closed = 1&lt;br /&gt;
&lt;br /&gt;
      # idl void writeBytes( [in] sequence seq );&lt;br /&gt;
      def writeBytes( self, seq ):&lt;br /&gt;
  self.t = self.t + seq      # simply add the incoming tuple to the member&lt;br /&gt;
&lt;br /&gt;
      # idl void flush();&lt;br /&gt;
      def flush( self ):&lt;br /&gt;
  pass&lt;br /&gt;
&lt;br /&gt;
      # convenience function to retrieve the tuple later (no UNO function, may&lt;br /&gt;
      # only be called from python )&lt;br /&gt;
      def getTuple( self ):&lt;br /&gt;
  return self.t&lt;br /&gt;
&lt;br /&gt;
# add the TupleOutputStream class to the implementation container,&lt;br /&gt;
# which the loader uses to register/instantiate the component.&lt;br /&gt;
g_ImplementationHelper.addImplementation( \&lt;br /&gt;
TupleOutputStream,&amp;quot;org.openoffice.pyuno.PythonOutputStream&amp;quot;,&lt;br /&gt;
                    (&amp;quot;com.sun.star.io.OutputStream&amp;quot;,),)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Asumamos, que este codigo es guardado en un archivo llamado tuplestrm.py y el archivo existe en algun lugar dentro de la variable PYTHONPATH, puede ser registrado al OO1beta construido del siguiente formato:&lt;br /&gt;
    regcomp -register -br types.rdb -br services.rdb -r services.rdb -c vnd.openoffice.pymodule:tuplestrm &lt;br /&gt;
&lt;br /&gt;
Claro que tambien puedes usar el pkgchk del tutorial en el capitulo&lt;br /&gt;
    pkgchk tuplestrm.py &lt;br /&gt;
&lt;br /&gt;
aunque este comando crea una copia del archivo (cuando el script cambia, debe ser reimplementado usando el comando que sigue. )&lt;br /&gt;
&lt;br /&gt;
Este componente puede ser llamado desde OpenOffice.org Basic con:&lt;br /&gt;
&amp;lt;code&amp;gt;[python]tupleStrm = createUnoService( &amp;quot;com.sun.star.io.OutputStream&amp;quot; )&lt;br /&gt;
tupleStrm.flush()&amp;lt;/code&amp;gt;&lt;br /&gt;
[[Category:ES]]&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156143</id>
		<title>Python es</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156143"/>
		<updated>2010-02-02T08:09:50Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Extensions}}&lt;br /&gt;
[[image:Py-uno_128.png|PyUNO Logo]] [[image:Pyuno_logo_a.jpg]] &lt;br /&gt;
=== Empezando con PyUNO ===&lt;br /&gt;
* Que es PyUNO ?&lt;br /&gt;
* Que necesito saber? &lt;br /&gt;
* Donde empiezo ?&lt;br /&gt;
** Desde Linux&lt;br /&gt;
** Desde Windows&lt;br /&gt;
* Donde guardo mis macros ? &lt;br /&gt;
** En el directorio compartido de OpenOffice.org&lt;br /&gt;
** En el directorio del usuario&lt;br /&gt;
** Dentro de un documento&lt;br /&gt;
* Mi primer macro &lt;br /&gt;
* PyUNO dentro de OpenOffice.org&lt;br /&gt;
* PyUNO fuera de OpenOffice.org&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Efforts on moving PyUNO to &amp;#039;&amp;#039;&amp;#039;Python 2.5&amp;#039;&amp;#039;&amp;#039; continue.  Liyuan is pushing this initiative and has [http://udk.openoffice.org/servlets/ReadMsg?listName=dev&amp;amp;msgNo=3704 commited the CWS] on the UDK mailing list.  The [[CWS]], however, is not ready, and was sent back on issue [http://www.openoffice.org/issues/show_bug.cgi?id=71327 71327].&lt;br /&gt;
&lt;br /&gt;
=== Python and OpenOffice.org ===&lt;br /&gt;
OpenOffice.org ships with the python scripting language, version 2.3.4.  This Python distribution comes with the [[Uno]] module, which connects the [[API|UNO API]] to the python scripting language.  To run this version of Python on Linux, you can go directly to the OpenOffice.org PATH.  And as one would expect with any distribution of Python, OOo-Python can be run from the command line as well.&lt;br /&gt;
&lt;br /&gt;
==== Where is the IDE ? ====&lt;br /&gt;
OpenOffice.org&amp;#039;s IDE doesn&amp;#039;t support Python, so development has to be done from another editor that does.  Any volunteer for a binding is welcomed.&lt;br /&gt;
&lt;br /&gt;
==== Tips &amp;amp; Tricks ====&lt;br /&gt;
&lt;br /&gt;
Here is some useful information about using python in OOo.&lt;br /&gt;
&lt;br /&gt;
===== Debug output =====&lt;br /&gt;
&lt;br /&gt;
If you launch a python script, any error will silently break the execution, making your extension hard to debug.  To change this behaviour, one can change the&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;LogLevel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
Have a look in &lt;br /&gt;
&amp;#039;&amp;#039;/path/to/ooo/program/&amp;#039;&amp;#039;&amp;#039;pythonscript.py&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
and replace &lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;NONE&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
with&lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;DEBUG&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
There are also currently-undocumented environment variables that tell the pyUno bridge to log every call.  Set the environment variable&lt;br /&gt;
&amp;#039;&amp;#039;export PYUNO_LOGLEVEL=ARGS&amp;#039;&amp;#039;&lt;br /&gt;
.  The output may be a little hard to read, but helpful nonetheless.&lt;br /&gt;
&lt;br /&gt;
Note that his applies only to Linux.  For Windows, you need some more switches, and the output gets written to files (there is no stdout on windows :-( ).&lt;br /&gt;
&lt;br /&gt;
There are still some error messages that won&amp;#039;t appear in these logs; this will improve in the near future (cws pyunofixes4).  Once the cws is integrated, I will document these switches on the official pyuno site. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Thanks to Joerg Budischewski&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== Python specific information for Extension creation ===&lt;br /&gt;
To create extensions for python, it is important that you have enough familiarity with the UNO components, as well as with packaging your code for easy distribution through the &amp;#039;&amp;#039;OpenOffice.org package manager&amp;#039;&amp;#039;.  Please check the tutorials to learn how to component-ize your code, and how to deploy remote scripting through a service implementation.&lt;br /&gt;
&lt;br /&gt;
To learn to run Python on Windows, visit [[Using Python on Windows| this link]] for more detailed information.&lt;br /&gt;
&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
*[[Using Python on Windows]] - New to Python? Learn how to use python on Windows&lt;br /&gt;
*[[Using Python on Linux]] - A must read for an overview on Python and OOo relations&lt;br /&gt;
* [[pyUNO bridge]] - Official page of the PyUNO bridge at the [http://udk.openoffice.org/ UDK site]&lt;br /&gt;
* [[Python as a macro language]] in OpenOffice.org 2.x - How to use the Python scripting framework&lt;br /&gt;
* [http://lucasmanual.com/mywiki/OpenOffice PyUNO Manual] Lukasz created a pyUNO manual. &amp;#039;&amp;#039;&amp;#039;new&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [http://www.linuxjournal.com/content/starting-stopping-and-connecting-openoffice-python Starting/Stopping and connecting using Python] From Linux Journal&lt;br /&gt;
* Introduction on testing pyUNO programs with [[doctests]]&lt;br /&gt;
* Create a [http://codesnippets.services.openoffice.org/Office/Office.MessageBoxWithTheUNOBasedToolkit.snip dialog box] in PyUNO.&lt;br /&gt;
* [http://codesnippets.services.openoffice.org/Office/Office.ConnectViaPipe.snip Connect to openoffice.org] from PyUNO&lt;br /&gt;
* [[PyUNO samples]] currently shipping with OpenOffice.org and the explanation.&lt;br /&gt;
* Enhanced [http://www.oooforum.org/forum/viewtopic.phtml?p=257496#257496 Capitalized.py] script by &amp;#039;&amp;#039;The gray Cardinal&amp;#039;&amp;#039; at OOoforum.&lt;br /&gt;
&lt;br /&gt;
=== PyUNO Modules ===&lt;br /&gt;
*[[Danny&amp;#039;s Python Modules]] - Collection guide from DannyB&amp;#039;s modules.&lt;br /&gt;
*[[PrinttoWriter.py]] - This makes it easy and convenient to print a bunch of text into a Writer document.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=8456 Developing Calc Functions in Python] - Learn how Python can be used to script your spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=56037#56037 Generating a Spreadsheet through Python] - Automatically generate new spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=9115 Python container components]&lt;br /&gt;
*[[PyUNOServer]] - The PyUNOServer is a script that works as an XML server for OpenOffice.org Calc&lt;br /&gt;
*[[calcParser]] - calcParser is a small parser using the native SAX utilities within the OpenOffice.org python&lt;br /&gt;
*[[OoConfig]] - OoConfig is a Python extension that seeks to provide a configuration editing facility similar to Mozilla&amp;#039;s about:config&lt;br /&gt;
*[[Bibliographic/Hints and Tips/OOoRISExport.py|OOoRISExport.py]] - Exports the bibliographic database in RIS format. Also [http://bibliographic.openoffice.org/files/documents/124/3078/RISImport.py RISImport.py]&lt;br /&gt;
*[[Zotero_Plugin |Zotero Plugin]] - The Zotero plugin provides citation and bibliographic table insertion and editing functions for Writer documents.&lt;br /&gt;
&lt;br /&gt;
=== Hacking Around ===&lt;br /&gt;
*[[UNO component packaging]] - How to create UNO components as well as the basics of script componentizing&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=38234#38234 Python component to parse XML] - Python is great to parse XML, PyUNO is also excellent when working with XML&lt;br /&gt;
*[[Example of Service in Python]] - Learn how to run Python as a service, this is useful for remote scripting.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=76972#76972 Modify spreadsheet] - Example of storing and retrieving a custom attribute on a spreadsheet cell.&lt;br /&gt;
*A simple [[daemon in Python]] - Learn how to run Python as a daemon&lt;br /&gt;
*[[Loook.py]] - a simple Python tool that searches for text strings in OpenOffice.org.&lt;br /&gt;
*[[odt2txt.py]] - convert ODF to plain text using python (and convert the txt to html).&lt;br /&gt;
&lt;br /&gt;
=== Python rules OOo (by B. Bois) ===&lt;br /&gt;
[[image:python_power_for_OOo.png|Python rules OOo :-)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:Uno]]&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156142</id>
		<title>Python es</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156142"/>
		<updated>2010-02-02T08:08:45Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Extensions}}&lt;br /&gt;
[[image:Py-uno_128.png|PyUNO Logo]] [[image:Pyuno_logo_a.jpg]] &lt;br /&gt;
=== Empezando con PyUNO ===&lt;br /&gt;
* Que es PyUNO ?&lt;br /&gt;
* Que necesito saber? &lt;br /&gt;
* Donde empiezo ?&lt;br /&gt;
** Desde Linux&lt;br /&gt;
** Desde Windows&lt;br /&gt;
* Donde guardo mis macros ? &lt;br /&gt;
** En el directorio compartido de OpenOffice.org&lt;br /&gt;
** En el directorio del usuario&lt;br /&gt;
** Dentro de un documento&lt;br /&gt;
* Mi primer macro ?&lt;br /&gt;
* PyUNO dentro de OpenOffice.org&lt;br /&gt;
* PyUNO fuera de OpenOffice.org&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Efforts on moving PyUNO to &amp;#039;&amp;#039;&amp;#039;Python 2.5&amp;#039;&amp;#039;&amp;#039; continue.  Liyuan is pushing this initiative and has [http://udk.openoffice.org/servlets/ReadMsg?listName=dev&amp;amp;msgNo=3704 commited the CWS] on the UDK mailing list.  The [[CWS]], however, is not ready, and was sent back on issue [http://www.openoffice.org/issues/show_bug.cgi?id=71327 71327].&lt;br /&gt;
&lt;br /&gt;
=== Python and OpenOffice.org ===&lt;br /&gt;
OpenOffice.org ships with the python scripting language, version 2.3.4.  This Python distribution comes with the [[Uno]] module, which connects the [[API|UNO API]] to the python scripting language.  To run this version of Python on Linux, you can go directly to the OpenOffice.org PATH.  And as one would expect with any distribution of Python, OOo-Python can be run from the command line as well.&lt;br /&gt;
&lt;br /&gt;
==== Where is the IDE ? ====&lt;br /&gt;
OpenOffice.org&amp;#039;s IDE doesn&amp;#039;t support Python, so development has to be done from another editor that does.  Any volunteer for a binding is welcomed.&lt;br /&gt;
&lt;br /&gt;
==== Tips &amp;amp; Tricks ====&lt;br /&gt;
&lt;br /&gt;
Here is some useful information about using python in OOo.&lt;br /&gt;
&lt;br /&gt;
===== Debug output =====&lt;br /&gt;
&lt;br /&gt;
If you launch a python script, any error will silently break the execution, making your extension hard to debug.  To change this behaviour, one can change the&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;LogLevel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
Have a look in &lt;br /&gt;
&amp;#039;&amp;#039;/path/to/ooo/program/&amp;#039;&amp;#039;&amp;#039;pythonscript.py&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
and replace &lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;NONE&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
with&lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;DEBUG&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
There are also currently-undocumented environment variables that tell the pyUno bridge to log every call.  Set the environment variable&lt;br /&gt;
&amp;#039;&amp;#039;export PYUNO_LOGLEVEL=ARGS&amp;#039;&amp;#039;&lt;br /&gt;
.  The output may be a little hard to read, but helpful nonetheless.&lt;br /&gt;
&lt;br /&gt;
Note that his applies only to Linux.  For Windows, you need some more switches, and the output gets written to files (there is no stdout on windows :-( ).&lt;br /&gt;
&lt;br /&gt;
There are still some error messages that won&amp;#039;t appear in these logs; this will improve in the near future (cws pyunofixes4).  Once the cws is integrated, I will document these switches on the official pyuno site. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Thanks to Joerg Budischewski&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== Python specific information for Extension creation ===&lt;br /&gt;
To create extensions for python, it is important that you have enough familiarity with the UNO components, as well as with packaging your code for easy distribution through the &amp;#039;&amp;#039;OpenOffice.org package manager&amp;#039;&amp;#039;.  Please check the tutorials to learn how to component-ize your code, and how to deploy remote scripting through a service implementation.&lt;br /&gt;
&lt;br /&gt;
To learn to run Python on Windows, visit [[Using Python on Windows| this link]] for more detailed information.&lt;br /&gt;
&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
*[[Using Python on Windows]] - New to Python? Learn how to use python on Windows&lt;br /&gt;
*[[Using Python on Linux]] - A must read for an overview on Python and OOo relations&lt;br /&gt;
* [[pyUNO bridge]] - Official page of the PyUNO bridge at the [http://udk.openoffice.org/ UDK site]&lt;br /&gt;
* [[Python as a macro language]] in OpenOffice.org 2.x - How to use the Python scripting framework&lt;br /&gt;
* [http://lucasmanual.com/mywiki/OpenOffice PyUNO Manual] Lukasz created a pyUNO manual. &amp;#039;&amp;#039;&amp;#039;new&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [http://www.linuxjournal.com/content/starting-stopping-and-connecting-openoffice-python Starting/Stopping and connecting using Python] From Linux Journal&lt;br /&gt;
* Introduction on testing pyUNO programs with [[doctests]]&lt;br /&gt;
* Create a [http://codesnippets.services.openoffice.org/Office/Office.MessageBoxWithTheUNOBasedToolkit.snip dialog box] in PyUNO.&lt;br /&gt;
* [http://codesnippets.services.openoffice.org/Office/Office.ConnectViaPipe.snip Connect to openoffice.org] from PyUNO&lt;br /&gt;
* [[PyUNO samples]] currently shipping with OpenOffice.org and the explanation.&lt;br /&gt;
* Enhanced [http://www.oooforum.org/forum/viewtopic.phtml?p=257496#257496 Capitalized.py] script by &amp;#039;&amp;#039;The gray Cardinal&amp;#039;&amp;#039; at OOoforum.&lt;br /&gt;
&lt;br /&gt;
=== PyUNO Modules ===&lt;br /&gt;
*[[Danny&amp;#039;s Python Modules]] - Collection guide from DannyB&amp;#039;s modules.&lt;br /&gt;
*[[PrinttoWriter.py]] - This makes it easy and convenient to print a bunch of text into a Writer document.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=8456 Developing Calc Functions in Python] - Learn how Python can be used to script your spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=56037#56037 Generating a Spreadsheet through Python] - Automatically generate new spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=9115 Python container components]&lt;br /&gt;
*[[PyUNOServer]] - The PyUNOServer is a script that works as an XML server for OpenOffice.org Calc&lt;br /&gt;
*[[calcParser]] - calcParser is a small parser using the native SAX utilities within the OpenOffice.org python&lt;br /&gt;
*[[OoConfig]] - OoConfig is a Python extension that seeks to provide a configuration editing facility similar to Mozilla&amp;#039;s about:config&lt;br /&gt;
*[[Bibliographic/Hints and Tips/OOoRISExport.py|OOoRISExport.py]] - Exports the bibliographic database in RIS format. Also [http://bibliographic.openoffice.org/files/documents/124/3078/RISImport.py RISImport.py]&lt;br /&gt;
*[[Zotero_Plugin |Zotero Plugin]] - The Zotero plugin provides citation and bibliographic table insertion and editing functions for Writer documents.&lt;br /&gt;
&lt;br /&gt;
=== Hacking Around ===&lt;br /&gt;
*[[UNO component packaging]] - How to create UNO components as well as the basics of script componentizing&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=38234#38234 Python component to parse XML] - Python is great to parse XML, PyUNO is also excellent when working with XML&lt;br /&gt;
*[[Example of Service in Python]] - Learn how to run Python as a service, this is useful for remote scripting.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=76972#76972 Modify spreadsheet] - Example of storing and retrieving a custom attribute on a spreadsheet cell.&lt;br /&gt;
*A simple [[daemon in Python]] - Learn how to run Python as a daemon&lt;br /&gt;
*[[Loook.py]] - a simple Python tool that searches for text strings in OpenOffice.org.&lt;br /&gt;
*[[odt2txt.py]] - convert ODF to plain text using python (and convert the txt to html).&lt;br /&gt;
&lt;br /&gt;
=== Python rules OOo (by B. Bois) ===&lt;br /&gt;
[[image:python_power_for_OOo.png|Python rules OOo :-)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:Uno]]&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156141</id>
		<title>Python es</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156141"/>
		<updated>2010-02-02T08:07:10Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Extensions}}&lt;br /&gt;
[[image:Py-uno_128.png|PyUNO Logo]] [[image:Pyuno_logo_a.jpg]] &lt;br /&gt;
=== Empezando con PyUNO ===&lt;br /&gt;
* Que es PyUNO ?&lt;br /&gt;
* Que necesito saber? &lt;br /&gt;
* Donde empiezo ?&lt;br /&gt;
** Desde Linux&lt;br /&gt;
** Desde Windows&lt;br /&gt;
* Donde guardo mis macros ? &lt;br /&gt;
** En el directorio compartido de OpenOffice.org&lt;br /&gt;
** En el directorio del usuario&lt;br /&gt;
** Dentro de un documento&lt;br /&gt;
* Mi primer macro ?&lt;br /&gt;
* PyUNO dentro de OpenOffice.org&lt;br /&gt;
* PyUNO fuera de OPenOffice.org&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Efforts on moving PyUNO to &amp;#039;&amp;#039;&amp;#039;Python 2.5&amp;#039;&amp;#039;&amp;#039; continue.  Liyuan is pushing this initiative and has [http://udk.openoffice.org/servlets/ReadMsg?listName=dev&amp;amp;msgNo=3704 commited the CWS] on the UDK mailing list.  The [[CWS]], however, is not ready, and was sent back on issue [http://www.openoffice.org/issues/show_bug.cgi?id=71327 71327].&lt;br /&gt;
&lt;br /&gt;
=== Python and OpenOffice.org ===&lt;br /&gt;
OpenOffice.org ships with the python scripting language, version 2.3.4.  This Python distribution comes with the [[Uno]] module, which connects the [[API|UNO API]] to the python scripting language.  To run this version of Python on Linux, you can go directly to the OpenOffice.org PATH.  And as one would expect with any distribution of Python, OOo-Python can be run from the command line as well.&lt;br /&gt;
&lt;br /&gt;
==== Where is the IDE ? ====&lt;br /&gt;
OpenOffice.org&amp;#039;s IDE doesn&amp;#039;t support Python, so development has to be done from another editor that does.  Any volunteer for a binding is welcomed.&lt;br /&gt;
&lt;br /&gt;
==== Tips &amp;amp; Tricks ====&lt;br /&gt;
&lt;br /&gt;
Here is some useful information about using python in OOo.&lt;br /&gt;
&lt;br /&gt;
===== Debug output =====&lt;br /&gt;
&lt;br /&gt;
If you launch a python script, any error will silently break the execution, making your extension hard to debug.  To change this behaviour, one can change the&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;LogLevel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
Have a look in &lt;br /&gt;
&amp;#039;&amp;#039;/path/to/ooo/program/&amp;#039;&amp;#039;&amp;#039;pythonscript.py&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
and replace &lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;NONE&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
with&lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;DEBUG&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
There are also currently-undocumented environment variables that tell the pyUno bridge to log every call.  Set the environment variable&lt;br /&gt;
&amp;#039;&amp;#039;export PYUNO_LOGLEVEL=ARGS&amp;#039;&amp;#039;&lt;br /&gt;
.  The output may be a little hard to read, but helpful nonetheless.&lt;br /&gt;
&lt;br /&gt;
Note that his applies only to Linux.  For Windows, you need some more switches, and the output gets written to files (there is no stdout on windows :-( ).&lt;br /&gt;
&lt;br /&gt;
There are still some error messages that won&amp;#039;t appear in these logs; this will improve in the near future (cws pyunofixes4).  Once the cws is integrated, I will document these switches on the official pyuno site. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Thanks to Joerg Budischewski&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== Python specific information for Extension creation ===&lt;br /&gt;
To create extensions for python, it is important that you have enough familiarity with the UNO components, as well as with packaging your code for easy distribution through the &amp;#039;&amp;#039;OpenOffice.org package manager&amp;#039;&amp;#039;.  Please check the tutorials to learn how to component-ize your code, and how to deploy remote scripting through a service implementation.&lt;br /&gt;
&lt;br /&gt;
To learn to run Python on Windows, visit [[Using Python on Windows| this link]] for more detailed information.&lt;br /&gt;
&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
*[[Using Python on Windows]] - New to Python? Learn how to use python on Windows&lt;br /&gt;
*[[Using Python on Linux]] - A must read for an overview on Python and OOo relations&lt;br /&gt;
* [[pyUNO bridge]] - Official page of the PyUNO bridge at the [http://udk.openoffice.org/ UDK site]&lt;br /&gt;
* [[Python as a macro language]] in OpenOffice.org 2.x - How to use the Python scripting framework&lt;br /&gt;
* [http://lucasmanual.com/mywiki/OpenOffice PyUNO Manual] Lukasz created a pyUNO manual. &amp;#039;&amp;#039;&amp;#039;new&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [http://www.linuxjournal.com/content/starting-stopping-and-connecting-openoffice-python Starting/Stopping and connecting using Python] From Linux Journal&lt;br /&gt;
* Introduction on testing pyUNO programs with [[doctests]]&lt;br /&gt;
* Create a [http://codesnippets.services.openoffice.org/Office/Office.MessageBoxWithTheUNOBasedToolkit.snip dialog box] in PyUNO.&lt;br /&gt;
* [http://codesnippets.services.openoffice.org/Office/Office.ConnectViaPipe.snip Connect to openoffice.org] from PyUNO&lt;br /&gt;
* [[PyUNO samples]] currently shipping with OpenOffice.org and the explanation.&lt;br /&gt;
* Enhanced [http://www.oooforum.org/forum/viewtopic.phtml?p=257496#257496 Capitalized.py] script by &amp;#039;&amp;#039;The gray Cardinal&amp;#039;&amp;#039; at OOoforum.&lt;br /&gt;
&lt;br /&gt;
=== PyUNO Modules ===&lt;br /&gt;
*[[Danny&amp;#039;s Python Modules]] - Collection guide from DannyB&amp;#039;s modules.&lt;br /&gt;
*[[PrinttoWriter.py]] - This makes it easy and convenient to print a bunch of text into a Writer document.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=8456 Developing Calc Functions in Python] - Learn how Python can be used to script your spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=56037#56037 Generating a Spreadsheet through Python] - Automatically generate new spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=9115 Python container components]&lt;br /&gt;
*[[PyUNOServer]] - The PyUNOServer is a script that works as an XML server for OpenOffice.org Calc&lt;br /&gt;
*[[calcParser]] - calcParser is a small parser using the native SAX utilities within the OpenOffice.org python&lt;br /&gt;
*[[OoConfig]] - OoConfig is a Python extension that seeks to provide a configuration editing facility similar to Mozilla&amp;#039;s about:config&lt;br /&gt;
*[[Bibliographic/Hints and Tips/OOoRISExport.py|OOoRISExport.py]] - Exports the bibliographic database in RIS format. Also [http://bibliographic.openoffice.org/files/documents/124/3078/RISImport.py RISImport.py]&lt;br /&gt;
*[[Zotero_Plugin |Zotero Plugin]] - The Zotero plugin provides citation and bibliographic table insertion and editing functions for Writer documents.&lt;br /&gt;
&lt;br /&gt;
=== Hacking Around ===&lt;br /&gt;
*[[UNO component packaging]] - How to create UNO components as well as the basics of script componentizing&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=38234#38234 Python component to parse XML] - Python is great to parse XML, PyUNO is also excellent when working with XML&lt;br /&gt;
*[[Example of Service in Python]] - Learn how to run Python as a service, this is useful for remote scripting.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=76972#76972 Modify spreadsheet] - Example of storing and retrieving a custom attribute on a spreadsheet cell.&lt;br /&gt;
*A simple [[daemon in Python]] - Learn how to run Python as a daemon&lt;br /&gt;
*[[Loook.py]] - a simple Python tool that searches for text strings in OpenOffice.org.&lt;br /&gt;
*[[odt2txt.py]] - convert ODF to plain text using python (and convert the txt to html).&lt;br /&gt;
&lt;br /&gt;
=== Python rules OOo (by B. Bois) ===&lt;br /&gt;
[[image:python_power_for_OOo.png|Python rules OOo :-)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:Uno]]&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156140</id>
		<title>Python es</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156140"/>
		<updated>2010-02-02T08:06:21Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Extensions}}&lt;br /&gt;
[[image:Py-uno_128.png|PyUNO Logo]] [[image:Pyuno_logo_a.jpg]] &lt;br /&gt;
=== Empezando con PyUNO ===&lt;br /&gt;
* Que es PyUno ?&lt;br /&gt;
* Que necesito saber? &lt;br /&gt;
* Donde empiezo ?&lt;br /&gt;
** Desde Linux&lt;br /&gt;
** Desde Windows&lt;br /&gt;
* Donde guardo mis macros ? &lt;br /&gt;
** En el directorio compartido de OpenOffice.org&lt;br /&gt;
** En el directorio del usuario&lt;br /&gt;
** Dentro de un documento&lt;br /&gt;
* Mi primer macro ?&lt;br /&gt;
* PyUNO dentro de OpenOffice.org&lt;br /&gt;
* PyUNO fuera de OPenOffice.org&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Efforts on moving PyUNO to &amp;#039;&amp;#039;&amp;#039;Python 2.5&amp;#039;&amp;#039;&amp;#039; continue.  Liyuan is pushing this initiative and has [http://udk.openoffice.org/servlets/ReadMsg?listName=dev&amp;amp;msgNo=3704 commited the CWS] on the UDK mailing list.  The [[CWS]], however, is not ready, and was sent back on issue [http://www.openoffice.org/issues/show_bug.cgi?id=71327 71327].&lt;br /&gt;
&lt;br /&gt;
=== Python and OpenOffice.org ===&lt;br /&gt;
OpenOffice.org ships with the python scripting language, version 2.3.4.  This Python distribution comes with the [[Uno]] module, which connects the [[API|UNO API]] to the python scripting language.  To run this version of Python on Linux, you can go directly to the OpenOffice.org PATH.  And as one would expect with any distribution of Python, OOo-Python can be run from the command line as well.&lt;br /&gt;
&lt;br /&gt;
==== Where is the IDE ? ====&lt;br /&gt;
OpenOffice.org&amp;#039;s IDE doesn&amp;#039;t support Python, so development has to be done from another editor that does.  Any volunteer for a binding is welcomed.&lt;br /&gt;
&lt;br /&gt;
==== Tips &amp;amp; Tricks ====&lt;br /&gt;
&lt;br /&gt;
Here is some useful information about using python in OOo.&lt;br /&gt;
&lt;br /&gt;
===== Debug output =====&lt;br /&gt;
&lt;br /&gt;
If you launch a python script, any error will silently break the execution, making your extension hard to debug.  To change this behaviour, one can change the&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;LogLevel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
Have a look in &lt;br /&gt;
&amp;#039;&amp;#039;/path/to/ooo/program/&amp;#039;&amp;#039;&amp;#039;pythonscript.py&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
and replace &lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;NONE&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
with&lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;DEBUG&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
There are also currently-undocumented environment variables that tell the pyUno bridge to log every call.  Set the environment variable&lt;br /&gt;
&amp;#039;&amp;#039;export PYUNO_LOGLEVEL=ARGS&amp;#039;&amp;#039;&lt;br /&gt;
.  The output may be a little hard to read, but helpful nonetheless.&lt;br /&gt;
&lt;br /&gt;
Note that his applies only to Linux.  For Windows, you need some more switches, and the output gets written to files (there is no stdout on windows :-( ).&lt;br /&gt;
&lt;br /&gt;
There are still some error messages that won&amp;#039;t appear in these logs; this will improve in the near future (cws pyunofixes4).  Once the cws is integrated, I will document these switches on the official pyuno site. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Thanks to Joerg Budischewski&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== Python specific information for Extension creation ===&lt;br /&gt;
To create extensions for python, it is important that you have enough familiarity with the UNO components, as well as with packaging your code for easy distribution through the &amp;#039;&amp;#039;OpenOffice.org package manager&amp;#039;&amp;#039;.  Please check the tutorials to learn how to component-ize your code, and how to deploy remote scripting through a service implementation.&lt;br /&gt;
&lt;br /&gt;
To learn to run Python on Windows, visit [[Using Python on Windows| this link]] for more detailed information.&lt;br /&gt;
&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
*[[Using Python on Windows]] - New to Python? Learn how to use python on Windows&lt;br /&gt;
*[[Using Python on Linux]] - A must read for an overview on Python and OOo relations&lt;br /&gt;
* [[pyUNO bridge]] - Official page of the PyUNO bridge at the [http://udk.openoffice.org/ UDK site]&lt;br /&gt;
* [[Python as a macro language]] in OpenOffice.org 2.x - How to use the Python scripting framework&lt;br /&gt;
* [http://lucasmanual.com/mywiki/OpenOffice PyUNO Manual] Lukasz created a pyUNO manual. &amp;#039;&amp;#039;&amp;#039;new&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [http://www.linuxjournal.com/content/starting-stopping-and-connecting-openoffice-python Starting/Stopping and connecting using Python] From Linux Journal&lt;br /&gt;
* Introduction on testing pyUNO programs with [[doctests]]&lt;br /&gt;
* Create a [http://codesnippets.services.openoffice.org/Office/Office.MessageBoxWithTheUNOBasedToolkit.snip dialog box] in PyUNO.&lt;br /&gt;
* [http://codesnippets.services.openoffice.org/Office/Office.ConnectViaPipe.snip Connect to openoffice.org] from PyUNO&lt;br /&gt;
* [[PyUNO samples]] currently shipping with OpenOffice.org and the explanation.&lt;br /&gt;
* Enhanced [http://www.oooforum.org/forum/viewtopic.phtml?p=257496#257496 Capitalized.py] script by &amp;#039;&amp;#039;The gray Cardinal&amp;#039;&amp;#039; at OOoforum.&lt;br /&gt;
&lt;br /&gt;
=== PyUNO Modules ===&lt;br /&gt;
*[[Danny&amp;#039;s Python Modules]] - Collection guide from DannyB&amp;#039;s modules.&lt;br /&gt;
*[[PrinttoWriter.py]] - This makes it easy and convenient to print a bunch of text into a Writer document.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=8456 Developing Calc Functions in Python] - Learn how Python can be used to script your spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=56037#56037 Generating a Spreadsheet through Python] - Automatically generate new spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=9115 Python container components]&lt;br /&gt;
*[[PyUNOServer]] - The PyUNOServer is a script that works as an XML server for OpenOffice.org Calc&lt;br /&gt;
*[[calcParser]] - calcParser is a small parser using the native SAX utilities within the OpenOffice.org python&lt;br /&gt;
*[[OoConfig]] - OoConfig is a Python extension that seeks to provide a configuration editing facility similar to Mozilla&amp;#039;s about:config&lt;br /&gt;
*[[Bibliographic/Hints and Tips/OOoRISExport.py|OOoRISExport.py]] - Exports the bibliographic database in RIS format. Also [http://bibliographic.openoffice.org/files/documents/124/3078/RISImport.py RISImport.py]&lt;br /&gt;
*[[Zotero_Plugin |Zotero Plugin]] - The Zotero plugin provides citation and bibliographic table insertion and editing functions for Writer documents.&lt;br /&gt;
&lt;br /&gt;
=== Hacking Around ===&lt;br /&gt;
*[[UNO component packaging]] - How to create UNO components as well as the basics of script componentizing&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=38234#38234 Python component to parse XML] - Python is great to parse XML, PyUNO is also excellent when working with XML&lt;br /&gt;
*[[Example of Service in Python]] - Learn how to run Python as a service, this is useful for remote scripting.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=76972#76972 Modify spreadsheet] - Example of storing and retrieving a custom attribute on a spreadsheet cell.&lt;br /&gt;
*A simple [[daemon in Python]] - Learn how to run Python as a daemon&lt;br /&gt;
*[[Loook.py]] - a simple Python tool that searches for text strings in OpenOffice.org.&lt;br /&gt;
*[[odt2txt.py]] - convert ODF to plain text using python (and convert the txt to html).&lt;br /&gt;
&lt;br /&gt;
=== Python rules OOo (by B. Bois) ===&lt;br /&gt;
[[image:python_power_for_OOo.png|Python rules OOo :-)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:Uno]]&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156139</id>
		<title>Python es</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156139"/>
		<updated>2010-02-02T08:05:45Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Extensions}}&lt;br /&gt;
[[image:Py-uno_128.png|PyUNO Logo]] [[image:Pyuno_logo_a.jpg]] &lt;br /&gt;
=== Empezando con PyUNO ===&lt;br /&gt;
* Que es PyUno ?&lt;br /&gt;
* Que necesito saber? &lt;br /&gt;
* Donde empiezo ?&lt;br /&gt;
** Desde Linux&lt;br /&gt;
** Desde Windows&lt;br /&gt;
* Donde guardo mis macros ? &lt;br /&gt;
** En el directorio compartido de OpenOffice.org&lt;br /&gt;
** En el directorio del usuario&lt;br /&gt;
** Dentro de un documento&lt;br /&gt;
* Mi primer macro ?&lt;br /&gt;
* PyUNO dentro de OpenOffice.org&lt;br /&gt;
* PyUNo fuera de OPenOffice.org&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Efforts on moving PyUNO to &amp;#039;&amp;#039;&amp;#039;Python 2.5&amp;#039;&amp;#039;&amp;#039; continue.  Liyuan is pushing this initiative and has [http://udk.openoffice.org/servlets/ReadMsg?listName=dev&amp;amp;msgNo=3704 commited the CWS] on the UDK mailing list.  The [[CWS]], however, is not ready, and was sent back on issue [http://www.openoffice.org/issues/show_bug.cgi?id=71327 71327].&lt;br /&gt;
&lt;br /&gt;
=== Python and OpenOffice.org ===&lt;br /&gt;
OpenOffice.org ships with the python scripting language, version 2.3.4.  This Python distribution comes with the [[Uno]] module, which connects the [[API|UNO API]] to the python scripting language.  To run this version of Python on Linux, you can go directly to the OpenOffice.org PATH.  And as one would expect with any distribution of Python, OOo-Python can be run from the command line as well.&lt;br /&gt;
&lt;br /&gt;
==== Where is the IDE ? ====&lt;br /&gt;
OpenOffice.org&amp;#039;s IDE doesn&amp;#039;t support Python, so development has to be done from another editor that does.  Any volunteer for a binding is welcomed.&lt;br /&gt;
&lt;br /&gt;
==== Tips &amp;amp; Tricks ====&lt;br /&gt;
&lt;br /&gt;
Here is some useful information about using python in OOo.&lt;br /&gt;
&lt;br /&gt;
===== Debug output =====&lt;br /&gt;
&lt;br /&gt;
If you launch a python script, any error will silently break the execution, making your extension hard to debug.  To change this behaviour, one can change the&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;LogLevel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
Have a look in &lt;br /&gt;
&amp;#039;&amp;#039;/path/to/ooo/program/&amp;#039;&amp;#039;&amp;#039;pythonscript.py&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
and replace &lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;NONE&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
with&lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;DEBUG&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
There are also currently-undocumented environment variables that tell the pyUno bridge to log every call.  Set the environment variable&lt;br /&gt;
&amp;#039;&amp;#039;export PYUNO_LOGLEVEL=ARGS&amp;#039;&amp;#039;&lt;br /&gt;
.  The output may be a little hard to read, but helpful nonetheless.&lt;br /&gt;
&lt;br /&gt;
Note that his applies only to Linux.  For Windows, you need some more switches, and the output gets written to files (there is no stdout on windows :-( ).&lt;br /&gt;
&lt;br /&gt;
There are still some error messages that won&amp;#039;t appear in these logs; this will improve in the near future (cws pyunofixes4).  Once the cws is integrated, I will document these switches on the official pyuno site. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Thanks to Joerg Budischewski&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== Python specific information for Extension creation ===&lt;br /&gt;
To create extensions for python, it is important that you have enough familiarity with the UNO components, as well as with packaging your code for easy distribution through the &amp;#039;&amp;#039;OpenOffice.org package manager&amp;#039;&amp;#039;.  Please check the tutorials to learn how to component-ize your code, and how to deploy remote scripting through a service implementation.&lt;br /&gt;
&lt;br /&gt;
To learn to run Python on Windows, visit [[Using Python on Windows| this link]] for more detailed information.&lt;br /&gt;
&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
*[[Using Python on Windows]] - New to Python? Learn how to use python on Windows&lt;br /&gt;
*[[Using Python on Linux]] - A must read for an overview on Python and OOo relations&lt;br /&gt;
* [[pyUNO bridge]] - Official page of the PyUNO bridge at the [http://udk.openoffice.org/ UDK site]&lt;br /&gt;
* [[Python as a macro language]] in OpenOffice.org 2.x - How to use the Python scripting framework&lt;br /&gt;
* [http://lucasmanual.com/mywiki/OpenOffice PyUNO Manual] Lukasz created a pyUNO manual. &amp;#039;&amp;#039;&amp;#039;new&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [http://www.linuxjournal.com/content/starting-stopping-and-connecting-openoffice-python Starting/Stopping and connecting using Python] From Linux Journal&lt;br /&gt;
* Introduction on testing pyUNO programs with [[doctests]]&lt;br /&gt;
* Create a [http://codesnippets.services.openoffice.org/Office/Office.MessageBoxWithTheUNOBasedToolkit.snip dialog box] in PyUNO.&lt;br /&gt;
* [http://codesnippets.services.openoffice.org/Office/Office.ConnectViaPipe.snip Connect to openoffice.org] from PyUNO&lt;br /&gt;
* [[PyUNO samples]] currently shipping with OpenOffice.org and the explanation.&lt;br /&gt;
* Enhanced [http://www.oooforum.org/forum/viewtopic.phtml?p=257496#257496 Capitalized.py] script by &amp;#039;&amp;#039;The gray Cardinal&amp;#039;&amp;#039; at OOoforum.&lt;br /&gt;
&lt;br /&gt;
=== PyUNO Modules ===&lt;br /&gt;
*[[Danny&amp;#039;s Python Modules]] - Collection guide from DannyB&amp;#039;s modules.&lt;br /&gt;
*[[PrinttoWriter.py]] - This makes it easy and convenient to print a bunch of text into a Writer document.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=8456 Developing Calc Functions in Python] - Learn how Python can be used to script your spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=56037#56037 Generating a Spreadsheet through Python] - Automatically generate new spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=9115 Python container components]&lt;br /&gt;
*[[PyUNOServer]] - The PyUNOServer is a script that works as an XML server for OpenOffice.org Calc&lt;br /&gt;
*[[calcParser]] - calcParser is a small parser using the native SAX utilities within the OpenOffice.org python&lt;br /&gt;
*[[OoConfig]] - OoConfig is a Python extension that seeks to provide a configuration editing facility similar to Mozilla&amp;#039;s about:config&lt;br /&gt;
*[[Bibliographic/Hints and Tips/OOoRISExport.py|OOoRISExport.py]] - Exports the bibliographic database in RIS format. Also [http://bibliographic.openoffice.org/files/documents/124/3078/RISImport.py RISImport.py]&lt;br /&gt;
*[[Zotero_Plugin |Zotero Plugin]] - The Zotero plugin provides citation and bibliographic table insertion and editing functions for Writer documents.&lt;br /&gt;
&lt;br /&gt;
=== Hacking Around ===&lt;br /&gt;
*[[UNO component packaging]] - How to create UNO components as well as the basics of script componentizing&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=38234#38234 Python component to parse XML] - Python is great to parse XML, PyUNO is also excellent when working with XML&lt;br /&gt;
*[[Example of Service in Python]] - Learn how to run Python as a service, this is useful for remote scripting.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=76972#76972 Modify spreadsheet] - Example of storing and retrieving a custom attribute on a spreadsheet cell.&lt;br /&gt;
*A simple [[daemon in Python]] - Learn how to run Python as a daemon&lt;br /&gt;
*[[Loook.py]] - a simple Python tool that searches for text strings in OpenOffice.org.&lt;br /&gt;
*[[odt2txt.py]] - convert ODF to plain text using python (and convert the txt to html).&lt;br /&gt;
&lt;br /&gt;
=== Python rules OOo (by B. Bois) ===&lt;br /&gt;
[[image:python_power_for_OOo.png|Python rules OOo :-)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:Uno]]&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156138</id>
		<title>Python es</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156138"/>
		<updated>2010-02-02T08:02:35Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Extensions}}&lt;br /&gt;
[[image:Py-uno_128.png|PyUNO Logo]] [[image:Pyuno_logo_a.jpg]] &lt;br /&gt;
=== Empezando con PyUNO ===&lt;br /&gt;
* Que es PyUno ?&lt;br /&gt;
* Que necesito saber? &lt;br /&gt;
* Donde empiezo ?&lt;br /&gt;
** Desde Linux&lt;br /&gt;
** Desde Windows&lt;br /&gt;
* Donde guardo mis macros ? &lt;br /&gt;
* Mi primer macro ?&lt;br /&gt;
* PyUNO dentro de OpenOffice.org&lt;br /&gt;
* PyUNo fuera de OPenOffice.org&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Efforts on moving PyUNO to &amp;#039;&amp;#039;&amp;#039;Python 2.5&amp;#039;&amp;#039;&amp;#039; continue.  Liyuan is pushing this initiative and has [http://udk.openoffice.org/servlets/ReadMsg?listName=dev&amp;amp;msgNo=3704 commited the CWS] on the UDK mailing list.  The [[CWS]], however, is not ready, and was sent back on issue [http://www.openoffice.org/issues/show_bug.cgi?id=71327 71327].&lt;br /&gt;
&lt;br /&gt;
=== Python and OpenOffice.org ===&lt;br /&gt;
OpenOffice.org ships with the python scripting language, version 2.3.4.  This Python distribution comes with the [[Uno]] module, which connects the [[API|UNO API]] to the python scripting language.  To run this version of Python on Linux, you can go directly to the OpenOffice.org PATH.  And as one would expect with any distribution of Python, OOo-Python can be run from the command line as well.&lt;br /&gt;
&lt;br /&gt;
==== Where is the IDE ? ====&lt;br /&gt;
OpenOffice.org&amp;#039;s IDE doesn&amp;#039;t support Python, so development has to be done from another editor that does.  Any volunteer for a binding is welcomed.&lt;br /&gt;
&lt;br /&gt;
==== Tips &amp;amp; Tricks ====&lt;br /&gt;
&lt;br /&gt;
Here is some useful information about using python in OOo.&lt;br /&gt;
&lt;br /&gt;
===== Debug output =====&lt;br /&gt;
&lt;br /&gt;
If you launch a python script, any error will silently break the execution, making your extension hard to debug.  To change this behaviour, one can change the&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;LogLevel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
Have a look in &lt;br /&gt;
&amp;#039;&amp;#039;/path/to/ooo/program/&amp;#039;&amp;#039;&amp;#039;pythonscript.py&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
and replace &lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;NONE&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
with&lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;DEBUG&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
There are also currently-undocumented environment variables that tell the pyUno bridge to log every call.  Set the environment variable&lt;br /&gt;
&amp;#039;&amp;#039;export PYUNO_LOGLEVEL=ARGS&amp;#039;&amp;#039;&lt;br /&gt;
.  The output may be a little hard to read, but helpful nonetheless.&lt;br /&gt;
&lt;br /&gt;
Note that his applies only to Linux.  For Windows, you need some more switches, and the output gets written to files (there is no stdout on windows :-( ).&lt;br /&gt;
&lt;br /&gt;
There are still some error messages that won&amp;#039;t appear in these logs; this will improve in the near future (cws pyunofixes4).  Once the cws is integrated, I will document these switches on the official pyuno site. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Thanks to Joerg Budischewski&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== Python specific information for Extension creation ===&lt;br /&gt;
To create extensions for python, it is important that you have enough familiarity with the UNO components, as well as with packaging your code for easy distribution through the &amp;#039;&amp;#039;OpenOffice.org package manager&amp;#039;&amp;#039;.  Please check the tutorials to learn how to component-ize your code, and how to deploy remote scripting through a service implementation.&lt;br /&gt;
&lt;br /&gt;
To learn to run Python on Windows, visit [[Using Python on Windows| this link]] for more detailed information.&lt;br /&gt;
&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
*[[Using Python on Windows]] - New to Python? Learn how to use python on Windows&lt;br /&gt;
*[[Using Python on Linux]] - A must read for an overview on Python and OOo relations&lt;br /&gt;
* [[pyUNO bridge]] - Official page of the PyUNO bridge at the [http://udk.openoffice.org/ UDK site]&lt;br /&gt;
* [[Python as a macro language]] in OpenOffice.org 2.x - How to use the Python scripting framework&lt;br /&gt;
* [http://lucasmanual.com/mywiki/OpenOffice PyUNO Manual] Lukasz created a pyUNO manual. &amp;#039;&amp;#039;&amp;#039;new&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [http://www.linuxjournal.com/content/starting-stopping-and-connecting-openoffice-python Starting/Stopping and connecting using Python] From Linux Journal&lt;br /&gt;
* Introduction on testing pyUNO programs with [[doctests]]&lt;br /&gt;
* Create a [http://codesnippets.services.openoffice.org/Office/Office.MessageBoxWithTheUNOBasedToolkit.snip dialog box] in PyUNO.&lt;br /&gt;
* [http://codesnippets.services.openoffice.org/Office/Office.ConnectViaPipe.snip Connect to openoffice.org] from PyUNO&lt;br /&gt;
* [[PyUNO samples]] currently shipping with OpenOffice.org and the explanation.&lt;br /&gt;
* Enhanced [http://www.oooforum.org/forum/viewtopic.phtml?p=257496#257496 Capitalized.py] script by &amp;#039;&amp;#039;The gray Cardinal&amp;#039;&amp;#039; at OOoforum.&lt;br /&gt;
&lt;br /&gt;
=== PyUNO Modules ===&lt;br /&gt;
*[[Danny&amp;#039;s Python Modules]] - Collection guide from DannyB&amp;#039;s modules.&lt;br /&gt;
*[[PrinttoWriter.py]] - This makes it easy and convenient to print a bunch of text into a Writer document.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=8456 Developing Calc Functions in Python] - Learn how Python can be used to script your spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=56037#56037 Generating a Spreadsheet through Python] - Automatically generate new spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=9115 Python container components]&lt;br /&gt;
*[[PyUNOServer]] - The PyUNOServer is a script that works as an XML server for OpenOffice.org Calc&lt;br /&gt;
*[[calcParser]] - calcParser is a small parser using the native SAX utilities within the OpenOffice.org python&lt;br /&gt;
*[[OoConfig]] - OoConfig is a Python extension that seeks to provide a configuration editing facility similar to Mozilla&amp;#039;s about:config&lt;br /&gt;
*[[Bibliographic/Hints and Tips/OOoRISExport.py|OOoRISExport.py]] - Exports the bibliographic database in RIS format. Also [http://bibliographic.openoffice.org/files/documents/124/3078/RISImport.py RISImport.py]&lt;br /&gt;
*[[Zotero_Plugin |Zotero Plugin]] - The Zotero plugin provides citation and bibliographic table insertion and editing functions for Writer documents.&lt;br /&gt;
&lt;br /&gt;
=== Hacking Around ===&lt;br /&gt;
*[[UNO component packaging]] - How to create UNO components as well as the basics of script componentizing&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=38234#38234 Python component to parse XML] - Python is great to parse XML, PyUNO is also excellent when working with XML&lt;br /&gt;
*[[Example of Service in Python]] - Learn how to run Python as a service, this is useful for remote scripting.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=76972#76972 Modify spreadsheet] - Example of storing and retrieving a custom attribute on a spreadsheet cell.&lt;br /&gt;
*A simple [[daemon in Python]] - Learn how to run Python as a daemon&lt;br /&gt;
*[[Loook.py]] - a simple Python tool that searches for text strings in OpenOffice.org.&lt;br /&gt;
*[[odt2txt.py]] - convert ODF to plain text using python (and convert the txt to html).&lt;br /&gt;
&lt;br /&gt;
=== Python rules OOo (by B. Bois) ===&lt;br /&gt;
[[image:python_power_for_OOo.png|Python rules OOo :-)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:Uno]]&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156132</id>
		<title>Python es</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156132"/>
		<updated>2010-02-02T07:36:04Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Extensions}}&lt;br /&gt;
[[image:Py-uno_128.png|PyUNO Logo]] [[image:Pyuno_logo_a.jpg]] &lt;br /&gt;
=== Empezando con PyUNO ===&lt;br /&gt;
* Que es PyUno ?&lt;br /&gt;
* Que necesito saber? &lt;br /&gt;
* Donde empiezo ?&lt;br /&gt;
** Desde Linux&lt;br /&gt;
** Desde Windows&lt;br /&gt;
* Donde guardo mis macros ? &lt;br /&gt;
* Mi primer macro ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Efforts on moving PyUNO to &amp;#039;&amp;#039;&amp;#039;Python 2.5&amp;#039;&amp;#039;&amp;#039; continue.  Liyuan is pushing this initiative and has [http://udk.openoffice.org/servlets/ReadMsg?listName=dev&amp;amp;msgNo=3704 commited the CWS] on the UDK mailing list.  The [[CWS]], however, is not ready, and was sent back on issue [http://www.openoffice.org/issues/show_bug.cgi?id=71327 71327].&lt;br /&gt;
&lt;br /&gt;
=== Python and OpenOffice.org ===&lt;br /&gt;
OpenOffice.org ships with the python scripting language, version 2.3.4.  This Python distribution comes with the [[Uno]] module, which connects the [[API|UNO API]] to the python scripting language.  To run this version of Python on Linux, you can go directly to the OpenOffice.org PATH.  And as one would expect with any distribution of Python, OOo-Python can be run from the command line as well.&lt;br /&gt;
&lt;br /&gt;
==== Where is the IDE ? ====&lt;br /&gt;
OpenOffice.org&amp;#039;s IDE doesn&amp;#039;t support Python, so development has to be done from another editor that does.  Any volunteer for a binding is welcomed.&lt;br /&gt;
&lt;br /&gt;
==== Tips &amp;amp; Tricks ====&lt;br /&gt;
&lt;br /&gt;
Here is some useful information about using python in OOo.&lt;br /&gt;
&lt;br /&gt;
===== Debug output =====&lt;br /&gt;
&lt;br /&gt;
If you launch a python script, any error will silently break the execution, making your extension hard to debug.  To change this behaviour, one can change the&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;LogLevel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
Have a look in &lt;br /&gt;
&amp;#039;&amp;#039;/path/to/ooo/program/&amp;#039;&amp;#039;&amp;#039;pythonscript.py&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
and replace &lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;NONE&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
with&lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;DEBUG&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
There are also currently-undocumented environment variables that tell the pyUno bridge to log every call.  Set the environment variable&lt;br /&gt;
&amp;#039;&amp;#039;export PYUNO_LOGLEVEL=ARGS&amp;#039;&amp;#039;&lt;br /&gt;
.  The output may be a little hard to read, but helpful nonetheless.&lt;br /&gt;
&lt;br /&gt;
Note that his applies only to Linux.  For Windows, you need some more switches, and the output gets written to files (there is no stdout on windows :-( ).&lt;br /&gt;
&lt;br /&gt;
There are still some error messages that won&amp;#039;t appear in these logs; this will improve in the near future (cws pyunofixes4).  Once the cws is integrated, I will document these switches on the official pyuno site. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Thanks to Joerg Budischewski&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== Python specific information for Extension creation ===&lt;br /&gt;
To create extensions for python, it is important that you have enough familiarity with the UNO components, as well as with packaging your code for easy distribution through the &amp;#039;&amp;#039;OpenOffice.org package manager&amp;#039;&amp;#039;.  Please check the tutorials to learn how to component-ize your code, and how to deploy remote scripting through a service implementation.&lt;br /&gt;
&lt;br /&gt;
To learn to run Python on Windows, visit [[Using Python on Windows| this link]] for more detailed information.&lt;br /&gt;
&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
*[[Using Python on Windows]] - New to Python? Learn how to use python on Windows&lt;br /&gt;
*[[Using Python on Linux]] - A must read for an overview on Python and OOo relations&lt;br /&gt;
* [[pyUNO bridge]] - Official page of the PyUNO bridge at the [http://udk.openoffice.org/ UDK site]&lt;br /&gt;
* [[Python as a macro language]] in OpenOffice.org 2.x - How to use the Python scripting framework&lt;br /&gt;
* [http://lucasmanual.com/mywiki/OpenOffice PyUNO Manual] Lukasz created a pyUNO manual. &amp;#039;&amp;#039;&amp;#039;new&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [http://www.linuxjournal.com/content/starting-stopping-and-connecting-openoffice-python Starting/Stopping and connecting using Python] From Linux Journal&lt;br /&gt;
* Introduction on testing pyUNO programs with [[doctests]]&lt;br /&gt;
* Create a [http://codesnippets.services.openoffice.org/Office/Office.MessageBoxWithTheUNOBasedToolkit.snip dialog box] in PyUNO.&lt;br /&gt;
* [http://codesnippets.services.openoffice.org/Office/Office.ConnectViaPipe.snip Connect to openoffice.org] from PyUNO&lt;br /&gt;
* [[PyUNO samples]] currently shipping with OpenOffice.org and the explanation.&lt;br /&gt;
* Enhanced [http://www.oooforum.org/forum/viewtopic.phtml?p=257496#257496 Capitalized.py] script by &amp;#039;&amp;#039;The gray Cardinal&amp;#039;&amp;#039; at OOoforum.&lt;br /&gt;
&lt;br /&gt;
=== PyUNO Modules ===&lt;br /&gt;
*[[Danny&amp;#039;s Python Modules]] - Collection guide from DannyB&amp;#039;s modules.&lt;br /&gt;
*[[PrinttoWriter.py]] - This makes it easy and convenient to print a bunch of text into a Writer document.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=8456 Developing Calc Functions in Python] - Learn how Python can be used to script your spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=56037#56037 Generating a Spreadsheet through Python] - Automatically generate new spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=9115 Python container components]&lt;br /&gt;
*[[PyUNOServer]] - The PyUNOServer is a script that works as an XML server for OpenOffice.org Calc&lt;br /&gt;
*[[calcParser]] - calcParser is a small parser using the native SAX utilities within the OpenOffice.org python&lt;br /&gt;
*[[OoConfig]] - OoConfig is a Python extension that seeks to provide a configuration editing facility similar to Mozilla&amp;#039;s about:config&lt;br /&gt;
*[[Bibliographic/Hints and Tips/OOoRISExport.py|OOoRISExport.py]] - Exports the bibliographic database in RIS format. Also [http://bibliographic.openoffice.org/files/documents/124/3078/RISImport.py RISImport.py]&lt;br /&gt;
*[[Zotero_Plugin |Zotero Plugin]] - The Zotero plugin provides citation and bibliographic table insertion and editing functions for Writer documents.&lt;br /&gt;
&lt;br /&gt;
=== Hacking Around ===&lt;br /&gt;
*[[UNO component packaging]] - How to create UNO components as well as the basics of script componentizing&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=38234#38234 Python component to parse XML] - Python is great to parse XML, PyUNO is also excellent when working with XML&lt;br /&gt;
*[[Example of Service in Python]] - Learn how to run Python as a service, this is useful for remote scripting.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=76972#76972 Modify spreadsheet] - Example of storing and retrieving a custom attribute on a spreadsheet cell.&lt;br /&gt;
*A simple [[daemon in Python]] - Learn how to run Python as a daemon&lt;br /&gt;
*[[Loook.py]] - a simple Python tool that searches for text strings in OpenOffice.org.&lt;br /&gt;
*[[odt2txt.py]] - convert ODF to plain text using python (and convert the txt to html).&lt;br /&gt;
&lt;br /&gt;
=== Python rules OOo (by B. Bois) ===&lt;br /&gt;
[[image:python_power_for_OOo.png|Python rules OOo :-)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:Uno]]&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156131</id>
		<title>Python es</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156131"/>
		<updated>2010-02-02T07:34:38Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Extensions}}&lt;br /&gt;
[[image:Py-uno_128.png|PyUNO Logo]] [[image:Pyuno_logo_a.jpg]] &lt;br /&gt;
=== Empezando con PyUNO ===&lt;br /&gt;
* Que es PyUno?&lt;br /&gt;
* Que necesito saber? &lt;br /&gt;
* Donde empiezo ?&lt;br /&gt;
** Desde Linux&lt;br /&gt;
** Desde Windows&lt;br /&gt;
* Donde guardo mis macros ? &lt;br /&gt;
&lt;br /&gt;
Efforts on moving PyUNO to &amp;#039;&amp;#039;&amp;#039;Python 2.5&amp;#039;&amp;#039;&amp;#039; continue.  Liyuan is pushing this initiative and has [http://udk.openoffice.org/servlets/ReadMsg?listName=dev&amp;amp;msgNo=3704 commited the CWS] on the UDK mailing list.  The [[CWS]], however, is not ready, and was sent back on issue [http://www.openoffice.org/issues/show_bug.cgi?id=71327 71327].&lt;br /&gt;
&lt;br /&gt;
=== Python and OpenOffice.org ===&lt;br /&gt;
OpenOffice.org ships with the python scripting language, version 2.3.4.  This Python distribution comes with the [[Uno]] module, which connects the [[API|UNO API]] to the python scripting language.  To run this version of Python on Linux, you can go directly to the OpenOffice.org PATH.  And as one would expect with any distribution of Python, OOo-Python can be run from the command line as well.&lt;br /&gt;
&lt;br /&gt;
==== Where is the IDE ? ====&lt;br /&gt;
OpenOffice.org&amp;#039;s IDE doesn&amp;#039;t support Python, so development has to be done from another editor that does.  Any volunteer for a binding is welcomed.&lt;br /&gt;
&lt;br /&gt;
==== Tips &amp;amp; Tricks ====&lt;br /&gt;
&lt;br /&gt;
Here is some useful information about using python in OOo.&lt;br /&gt;
&lt;br /&gt;
===== Debug output =====&lt;br /&gt;
&lt;br /&gt;
If you launch a python script, any error will silently break the execution, making your extension hard to debug.  To change this behaviour, one can change the&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;LogLevel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
Have a look in &lt;br /&gt;
&amp;#039;&amp;#039;/path/to/ooo/program/&amp;#039;&amp;#039;&amp;#039;pythonscript.py&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
and replace &lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;NONE&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
with&lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;DEBUG&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
There are also currently-undocumented environment variables that tell the pyUno bridge to log every call.  Set the environment variable&lt;br /&gt;
&amp;#039;&amp;#039;export PYUNO_LOGLEVEL=ARGS&amp;#039;&amp;#039;&lt;br /&gt;
.  The output may be a little hard to read, but helpful nonetheless.&lt;br /&gt;
&lt;br /&gt;
Note that his applies only to Linux.  For Windows, you need some more switches, and the output gets written to files (there is no stdout on windows :-( ).&lt;br /&gt;
&lt;br /&gt;
There are still some error messages that won&amp;#039;t appear in these logs; this will improve in the near future (cws pyunofixes4).  Once the cws is integrated, I will document these switches on the official pyuno site. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Thanks to Joerg Budischewski&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== Python specific information for Extension creation ===&lt;br /&gt;
To create extensions for python, it is important that you have enough familiarity with the UNO components, as well as with packaging your code for easy distribution through the &amp;#039;&amp;#039;OpenOffice.org package manager&amp;#039;&amp;#039;.  Please check the tutorials to learn how to component-ize your code, and how to deploy remote scripting through a service implementation.&lt;br /&gt;
&lt;br /&gt;
To learn to run Python on Windows, visit [[Using Python on Windows| this link]] for more detailed information.&lt;br /&gt;
&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
*[[Using Python on Windows]] - New to Python? Learn how to use python on Windows&lt;br /&gt;
*[[Using Python on Linux]] - A must read for an overview on Python and OOo relations&lt;br /&gt;
* [[pyUNO bridge]] - Official page of the PyUNO bridge at the [http://udk.openoffice.org/ UDK site]&lt;br /&gt;
* [[Python as a macro language]] in OpenOffice.org 2.x - How to use the Python scripting framework&lt;br /&gt;
* [http://lucasmanual.com/mywiki/OpenOffice PyUNO Manual] Lukasz created a pyUNO manual. &amp;#039;&amp;#039;&amp;#039;new&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [http://www.linuxjournal.com/content/starting-stopping-and-connecting-openoffice-python Starting/Stopping and connecting using Python] From Linux Journal&lt;br /&gt;
* Introduction on testing pyUNO programs with [[doctests]]&lt;br /&gt;
* Create a [http://codesnippets.services.openoffice.org/Office/Office.MessageBoxWithTheUNOBasedToolkit.snip dialog box] in PyUNO.&lt;br /&gt;
* [http://codesnippets.services.openoffice.org/Office/Office.ConnectViaPipe.snip Connect to openoffice.org] from PyUNO&lt;br /&gt;
* [[PyUNO samples]] currently shipping with OpenOffice.org and the explanation.&lt;br /&gt;
* Enhanced [http://www.oooforum.org/forum/viewtopic.phtml?p=257496#257496 Capitalized.py] script by &amp;#039;&amp;#039;The gray Cardinal&amp;#039;&amp;#039; at OOoforum.&lt;br /&gt;
&lt;br /&gt;
=== PyUNO Modules ===&lt;br /&gt;
*[[Danny&amp;#039;s Python Modules]] - Collection guide from DannyB&amp;#039;s modules.&lt;br /&gt;
*[[PrinttoWriter.py]] - This makes it easy and convenient to print a bunch of text into a Writer document.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=8456 Developing Calc Functions in Python] - Learn how Python can be used to script your spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=56037#56037 Generating a Spreadsheet through Python] - Automatically generate new spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=9115 Python container components]&lt;br /&gt;
*[[PyUNOServer]] - The PyUNOServer is a script that works as an XML server for OpenOffice.org Calc&lt;br /&gt;
*[[calcParser]] - calcParser is a small parser using the native SAX utilities within the OpenOffice.org python&lt;br /&gt;
*[[OoConfig]] - OoConfig is a Python extension that seeks to provide a configuration editing facility similar to Mozilla&amp;#039;s about:config&lt;br /&gt;
*[[Bibliographic/Hints and Tips/OOoRISExport.py|OOoRISExport.py]] - Exports the bibliographic database in RIS format. Also [http://bibliographic.openoffice.org/files/documents/124/3078/RISImport.py RISImport.py]&lt;br /&gt;
*[[Zotero_Plugin |Zotero Plugin]] - The Zotero plugin provides citation and bibliographic table insertion and editing functions for Writer documents.&lt;br /&gt;
&lt;br /&gt;
=== Hacking Around ===&lt;br /&gt;
*[[UNO component packaging]] - How to create UNO components as well as the basics of script componentizing&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=38234#38234 Python component to parse XML] - Python is great to parse XML, PyUNO is also excellent when working with XML&lt;br /&gt;
*[[Example of Service in Python]] - Learn how to run Python as a service, this is useful for remote scripting.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=76972#76972 Modify spreadsheet] - Example of storing and retrieving a custom attribute on a spreadsheet cell.&lt;br /&gt;
*A simple [[daemon in Python]] - Learn how to run Python as a daemon&lt;br /&gt;
*[[Loook.py]] - a simple Python tool that searches for text strings in OpenOffice.org.&lt;br /&gt;
*[[odt2txt.py]] - convert ODF to plain text using python (and convert the txt to html).&lt;br /&gt;
&lt;br /&gt;
=== Python rules OOo (by B. Bois) ===&lt;br /&gt;
[[image:python_power_for_OOo.png|Python rules OOo :-)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:Uno]]&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156122</id>
		<title>Python es</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156122"/>
		<updated>2010-02-02T07:23:06Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Extensions}}&lt;br /&gt;
[[image:Py-uno_128.png|PyUNO Logo]] [[image:Pyuno_logo_a.jpg]] &lt;br /&gt;
=== Empezando con PyUNO ===&lt;br /&gt;
Efforts on moving PyUNO to &amp;#039;&amp;#039;&amp;#039;Python 2.5&amp;#039;&amp;#039;&amp;#039; continue.  Liyuan is pushing this initiative and has [http://udk.openoffice.org/servlets/ReadMsg?listName=dev&amp;amp;msgNo=3704 commited the CWS] on the UDK mailing list.  The [[CWS]], however, is not ready, and was sent back on issue [http://www.openoffice.org/issues/show_bug.cgi?id=71327 71327].&lt;br /&gt;
&lt;br /&gt;
=== Python and OpenOffice.org ===&lt;br /&gt;
OpenOffice.org ships with the python scripting language, version 2.3.4.  This Python distribution comes with the [[Uno]] module, which connects the [[API|UNO API]] to the python scripting language.  To run this version of Python on Linux, you can go directly to the OpenOffice.org PATH.  And as one would expect with any distribution of Python, OOo-Python can be run from the command line as well.&lt;br /&gt;
&lt;br /&gt;
==== Where is the IDE ? ====&lt;br /&gt;
OpenOffice.org&amp;#039;s IDE doesn&amp;#039;t support Python, so development has to be done from another editor that does.  Any volunteer for a binding is welcomed.&lt;br /&gt;
&lt;br /&gt;
==== Tips &amp;amp; Tricks ====&lt;br /&gt;
&lt;br /&gt;
Here is some useful information about using python in OOo.&lt;br /&gt;
&lt;br /&gt;
===== Debug output =====&lt;br /&gt;
&lt;br /&gt;
If you launch a python script, any error will silently break the execution, making your extension hard to debug.  To change this behaviour, one can change the&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;LogLevel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
Have a look in &lt;br /&gt;
&amp;#039;&amp;#039;/path/to/ooo/program/&amp;#039;&amp;#039;&amp;#039;pythonscript.py&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
and replace &lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;NONE&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
with&lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;DEBUG&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
There are also currently-undocumented environment variables that tell the pyUno bridge to log every call.  Set the environment variable&lt;br /&gt;
&amp;#039;&amp;#039;export PYUNO_LOGLEVEL=ARGS&amp;#039;&amp;#039;&lt;br /&gt;
.  The output may be a little hard to read, but helpful nonetheless.&lt;br /&gt;
&lt;br /&gt;
Note that his applies only to Linux.  For Windows, you need some more switches, and the output gets written to files (there is no stdout on windows :-( ).&lt;br /&gt;
&lt;br /&gt;
There are still some error messages that won&amp;#039;t appear in these logs; this will improve in the near future (cws pyunofixes4).  Once the cws is integrated, I will document these switches on the official pyuno site. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Thanks to Joerg Budischewski&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== Python specific information for Extension creation ===&lt;br /&gt;
To create extensions for python, it is important that you have enough familiarity with the UNO components, as well as with packaging your code for easy distribution through the &amp;#039;&amp;#039;OpenOffice.org package manager&amp;#039;&amp;#039;.  Please check the tutorials to learn how to component-ize your code, and how to deploy remote scripting through a service implementation.&lt;br /&gt;
&lt;br /&gt;
To learn to run Python on Windows, visit [[Using Python on Windows| this link]] for more detailed information.&lt;br /&gt;
&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
*[[Using Python on Windows]] - New to Python? Learn how to use python on Windows&lt;br /&gt;
*[[Using Python on Linux]] - A must read for an overview on Python and OOo relations&lt;br /&gt;
* [[pyUNO bridge]] - Official page of the PyUNO bridge at the [http://udk.openoffice.org/ UDK site]&lt;br /&gt;
* [[Python as a macro language]] in OpenOffice.org 2.x - How to use the Python scripting framework&lt;br /&gt;
* [http://lucasmanual.com/mywiki/OpenOffice PyUNO Manual] Lukasz created a pyUNO manual. &amp;#039;&amp;#039;&amp;#039;new&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [http://www.linuxjournal.com/content/starting-stopping-and-connecting-openoffice-python Starting/Stopping and connecting using Python] From Linux Journal&lt;br /&gt;
* Introduction on testing pyUNO programs with [[doctests]]&lt;br /&gt;
* Create a [http://codesnippets.services.openoffice.org/Office/Office.MessageBoxWithTheUNOBasedToolkit.snip dialog box] in PyUNO.&lt;br /&gt;
* [http://codesnippets.services.openoffice.org/Office/Office.ConnectViaPipe.snip Connect to openoffice.org] from PyUNO&lt;br /&gt;
* [[PyUNO samples]] currently shipping with OpenOffice.org and the explanation.&lt;br /&gt;
* Enhanced [http://www.oooforum.org/forum/viewtopic.phtml?p=257496#257496 Capitalized.py] script by &amp;#039;&amp;#039;The gray Cardinal&amp;#039;&amp;#039; at OOoforum.&lt;br /&gt;
&lt;br /&gt;
=== PyUNO Modules ===&lt;br /&gt;
*[[Danny&amp;#039;s Python Modules]] - Collection guide from DannyB&amp;#039;s modules.&lt;br /&gt;
*[[PrinttoWriter.py]] - This makes it easy and convenient to print a bunch of text into a Writer document.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=8456 Developing Calc Functions in Python] - Learn how Python can be used to script your spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=56037#56037 Generating a Spreadsheet through Python] - Automatically generate new spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=9115 Python container components]&lt;br /&gt;
*[[PyUNOServer]] - The PyUNOServer is a script that works as an XML server for OpenOffice.org Calc&lt;br /&gt;
*[[calcParser]] - calcParser is a small parser using the native SAX utilities within the OpenOffice.org python&lt;br /&gt;
*[[OoConfig]] - OoConfig is a Python extension that seeks to provide a configuration editing facility similar to Mozilla&amp;#039;s about:config&lt;br /&gt;
*[[Bibliographic/Hints and Tips/OOoRISExport.py|OOoRISExport.py]] - Exports the bibliographic database in RIS format. Also [http://bibliographic.openoffice.org/files/documents/124/3078/RISImport.py RISImport.py]&lt;br /&gt;
*[[Zotero_Plugin |Zotero Plugin]] - The Zotero plugin provides citation and bibliographic table insertion and editing functions for Writer documents.&lt;br /&gt;
&lt;br /&gt;
=== Hacking Around ===&lt;br /&gt;
*[[UNO component packaging]] - How to create UNO components as well as the basics of script componentizing&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=38234#38234 Python component to parse XML] - Python is great to parse XML, PyUNO is also excellent when working with XML&lt;br /&gt;
*[[Example of Service in Python]] - Learn how to run Python as a service, this is useful for remote scripting.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=76972#76972 Modify spreadsheet] - Example of storing and retrieving a custom attribute on a spreadsheet cell.&lt;br /&gt;
*A simple [[daemon in Python]] - Learn how to run Python as a daemon&lt;br /&gt;
*[[Loook.py]] - a simple Python tool that searches for text strings in OpenOffice.org.&lt;br /&gt;
*[[odt2txt.py]] - convert ODF to plain text using python (and convert the txt to html).&lt;br /&gt;
&lt;br /&gt;
=== Python rules OOo (by B. Bois) ===&lt;br /&gt;
[[image:python_power_for_OOo.png|Python rules OOo :-)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:Uno]]&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156118</id>
		<title>Python es</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Python_es&amp;diff=156118"/>
		<updated>2010-02-02T07:17:02Z</updated>

		<summary type="html">&lt;p&gt;Mauricio: Created page with &amp;#039;{{Extensions}} PyUNO Logo image:Pyuno_logo_a.jpg  === News === Efforts on moving PyUNO to &amp;#039;&amp;#039;&amp;#039;Python 2.5&amp;#039;&amp;#039;&amp;#039; continue.  Liyuan is pushing this initiati…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Extensions}}&lt;br /&gt;
[[image:Py-uno_128.png|PyUNO Logo]] [[image:Pyuno_logo_a.jpg]] &lt;br /&gt;
=== News ===&lt;br /&gt;
Efforts on moving PyUNO to &amp;#039;&amp;#039;&amp;#039;Python 2.5&amp;#039;&amp;#039;&amp;#039; continue.  Liyuan is pushing this initiative and has [http://udk.openoffice.org/servlets/ReadMsg?listName=dev&amp;amp;msgNo=3704 commited the CWS] on the UDK mailing list.  The [[CWS]], however, is not ready, and was sent back on issue [http://www.openoffice.org/issues/show_bug.cgi?id=71327 71327].&lt;br /&gt;
&lt;br /&gt;
=== Python and OpenOffice.org ===&lt;br /&gt;
OpenOffice.org ships with the python scripting language, version 2.3.4.  This Python distribution comes with the [[Uno]] module, which connects the [[API|UNO API]] to the python scripting language.  To run this version of Python on Linux, you can go directly to the OpenOffice.org PATH.  And as one would expect with any distribution of Python, OOo-Python can be run from the command line as well.&lt;br /&gt;
&lt;br /&gt;
==== Where is the IDE ? ====&lt;br /&gt;
OpenOffice.org&amp;#039;s IDE doesn&amp;#039;t support Python, so development has to be done from another editor that does.  Any volunteer for a binding is welcomed.&lt;br /&gt;
&lt;br /&gt;
==== Tips &amp;amp; Tricks ====&lt;br /&gt;
&lt;br /&gt;
Here is some useful information about using python in OOo.&lt;br /&gt;
&lt;br /&gt;
===== Debug output =====&lt;br /&gt;
&lt;br /&gt;
If you launch a python script, any error will silently break the execution, making your extension hard to debug.  To change this behaviour, one can change the&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;LogLevel&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
Have a look in &lt;br /&gt;
&amp;#039;&amp;#039;/path/to/ooo/program/&amp;#039;&amp;#039;&amp;#039;pythonscript.py&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
and replace &lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;NONE&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
with&lt;br /&gt;
&amp;#039;&amp;#039;LogLevel.use = LogLevel.&amp;#039;&amp;#039;&amp;#039;DEBUG&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
There are also currently-undocumented environment variables that tell the pyUno bridge to log every call.  Set the environment variable&lt;br /&gt;
&amp;#039;&amp;#039;export PYUNO_LOGLEVEL=ARGS&amp;#039;&amp;#039;&lt;br /&gt;
.  The output may be a little hard to read, but helpful nonetheless.&lt;br /&gt;
&lt;br /&gt;
Note that his applies only to Linux.  For Windows, you need some more switches, and the output gets written to files (there is no stdout on windows :-( ).&lt;br /&gt;
&lt;br /&gt;
There are still some error messages that won&amp;#039;t appear in these logs; this will improve in the near future (cws pyunofixes4).  Once the cws is integrated, I will document these switches on the official pyuno site. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Thanks to Joerg Budischewski&amp;#039;&amp;#039;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== Python specific information for Extension creation ===&lt;br /&gt;
To create extensions for python, it is important that you have enough familiarity with the UNO components, as well as with packaging your code for easy distribution through the &amp;#039;&amp;#039;OpenOffice.org package manager&amp;#039;&amp;#039;.  Please check the tutorials to learn how to component-ize your code, and how to deploy remote scripting through a service implementation.&lt;br /&gt;
&lt;br /&gt;
To learn to run Python on Windows, visit [[Using Python on Windows| this link]] for more detailed information.&lt;br /&gt;
&lt;br /&gt;
=== Getting Started ===&lt;br /&gt;
*[[Using Python on Windows]] - New to Python? Learn how to use python on Windows&lt;br /&gt;
*[[Using Python on Linux]] - A must read for an overview on Python and OOo relations&lt;br /&gt;
* [[pyUNO bridge]] - Official page of the PyUNO bridge at the [http://udk.openoffice.org/ UDK site]&lt;br /&gt;
* [[Python as a macro language]] in OpenOffice.org 2.x - How to use the Python scripting framework&lt;br /&gt;
* [http://lucasmanual.com/mywiki/OpenOffice PyUNO Manual] Lukasz created a pyUNO manual. &amp;#039;&amp;#039;&amp;#039;new&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* [http://www.linuxjournal.com/content/starting-stopping-and-connecting-openoffice-python Starting/Stopping and connecting using Python] From Linux Journal&lt;br /&gt;
* Introduction on testing pyUNO programs with [[doctests]]&lt;br /&gt;
* Create a [http://codesnippets.services.openoffice.org/Office/Office.MessageBoxWithTheUNOBasedToolkit.snip dialog box] in PyUNO.&lt;br /&gt;
* [http://codesnippets.services.openoffice.org/Office/Office.ConnectViaPipe.snip Connect to openoffice.org] from PyUNO&lt;br /&gt;
* [[PyUNO samples]] currently shipping with OpenOffice.org and the explanation.&lt;br /&gt;
* Enhanced [http://www.oooforum.org/forum/viewtopic.phtml?p=257496#257496 Capitalized.py] script by &amp;#039;&amp;#039;The gray Cardinal&amp;#039;&amp;#039; at OOoforum.&lt;br /&gt;
&lt;br /&gt;
=== PyUNO Modules ===&lt;br /&gt;
*[[Danny&amp;#039;s Python Modules]] - Collection guide from DannyB&amp;#039;s modules.&lt;br /&gt;
*[[PrinttoWriter.py]] - This makes it easy and convenient to print a bunch of text into a Writer document.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=8456 Developing Calc Functions in Python] - Learn how Python can be used to script your spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=56037#56037 Generating a Spreadsheet through Python] - Automatically generate new spreadsheets&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?t=9115 Python container components]&lt;br /&gt;
*[[PyUNOServer]] - The PyUNOServer is a script that works as an XML server for OpenOffice.org Calc&lt;br /&gt;
*[[calcParser]] - calcParser is a small parser using the native SAX utilities within the OpenOffice.org python&lt;br /&gt;
*[[OoConfig]] - OoConfig is a Python extension that seeks to provide a configuration editing facility similar to Mozilla&amp;#039;s about:config&lt;br /&gt;
*[[Bibliographic/Hints and Tips/OOoRISExport.py|OOoRISExport.py]] - Exports the bibliographic database in RIS format. Also [http://bibliographic.openoffice.org/files/documents/124/3078/RISImport.py RISImport.py]&lt;br /&gt;
*[[Zotero_Plugin |Zotero Plugin]] - The Zotero plugin provides citation and bibliographic table insertion and editing functions for Writer documents.&lt;br /&gt;
&lt;br /&gt;
=== Hacking Around ===&lt;br /&gt;
*[[UNO component packaging]] - How to create UNO components as well as the basics of script componentizing&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=38234#38234 Python component to parse XML] - Python is great to parse XML, PyUNO is also excellent when working with XML&lt;br /&gt;
*[[Example of Service in Python]] - Learn how to run Python as a service, this is useful for remote scripting.&lt;br /&gt;
*[http://www.oooforum.org/forum/viewtopic.phtml?p=76972#76972 Modify spreadsheet] - Example of storing and retrieving a custom attribute on a spreadsheet cell.&lt;br /&gt;
*A simple [[daemon in Python]] - Learn how to run Python as a daemon&lt;br /&gt;
*[[Loook.py]] - a simple Python tool that searches for text strings in OpenOffice.org.&lt;br /&gt;
*[[odt2txt.py]] - convert ODF to plain text using python (and convert the txt to html).&lt;br /&gt;
&lt;br /&gt;
=== Python rules OOo (by B. Bois) ===&lt;br /&gt;
[[image:python_power_for_OOo.png|Python rules OOo :-)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Extensions]]&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:Uno]]&lt;/div&gt;</summary>
		<author><name>Mauricio</name></author>
	</entry>
</feed>