Difference between revisions of "Python de"
(→Python rules OOo (by B. Bois)) |
(→Getting Started) |
||
Line 40: | Line 40: | ||
To learn to run Python on Windows you could visit [[Using Python on Windows| this link]] for more detail information. | To learn to run Python on Windows you could visit [[Using Python on Windows| this link]] for more detail information. | ||
− | === | + | === Starten === |
− | *[[Using Python on Windows]] - | + | *[[Using Python on Windows]] - Neu in Python? Lernen, wie man Python auf Windows verwendet |
− | *[[Using Python on Linux]] - | + | *[[Using Python on Linux]] - Eine Pflichtlektüre für einen Überblick zu Python und den OOo-Verbindungen |
− | * [[pyUNO bridge]] - | + | * [[pyUNO bridge]] - Offizielle Seite der PyUNO-Brücke auf [http://udk.openoffice.org/ UDK Seite] |
− | * [[Python as a macro language]] in OpenOffice.org 2.x - | + | * [[Python as a macro language]] in OpenOffice.org 2.x - Wie das Python-Skripting-Rahmenwerk benutzt wird |
− | * | + | * Einführung in das Testen von PyUNO-Programmen mit [[doctests]] |
− | * | + | * Erstelle eine [http://codesnippets.services.openoffice.org/Office/Office.MessageBoxWithTheUNOBasedToolkit.snip dialog box] in PyUNO. |
− | * [http://codesnippets.services.openoffice.org/Office/Office.ConnectViaPipe.snip Connect to openoffice.org] | + | * [http://codesnippets.services.openoffice.org/Office/Office.ConnectViaPipe.snip Connect to openoffice.org] von PyUNO |
− | * [[PyUNO samples]] | + | * [[PyUNO samples]] derzeit mit OpenOffice.org ausgeliefert und die Erklärung dazu. |
− | * | + | * Erweitertes [http://www.oooforum.org/forum/viewtopic.phtml?p=257496#257496 Capitalized.py] Skript von ''The gray Cardinal'' im OOoforum. |
=== PyUNO Modules === | === PyUNO Modules === |
Revision as of 21:11, 30 January 2008
OOo Extensions project
Please view the wiki usage guidelines
|
---|
Categories: Pages: |
Extensions on the main site |
Extensions in other languages: |
Contents
Neuigkeiten
Bemühungen PyUNO zu Python 2.5 zu bewegen, gehen weiter. Liyuan forciert diese Initiative und hat den Child Work Space (CWS) übermittelt auf der UDK-Mailingliste. Der CWS ist allerdings noch nicht fertig und wurde an den Issue 71327 zurückgeschickt.
Python und OpenOffice.org
OpenOffice.org wird mit einer Python-Skriptsprache in Ihrer Version 2.3.4 ausgeliefert. Diese Python-Distribution wird mit den Uno-Modulen geliefert, die die UNO API mit der Python-Skriptsprache verbinden. Um diese Version von Python auf Linux zu starten, können sie zum direkten OpenOffice.org-Pfad (PATH) gehen. OOo-Python kann genau so von der Kommandozeile gestartet werden, wie sie es von jeder anderen Python-Distribution erwarten.
Wo ist die IDE ?
OpenOffice.org's IDE unterstützt nicht Python, so dass die Entwicklung aus einem anderen Editor heraus erfolgen muss, der hierzu geeignet ist. Jeder Freiwillige für eine Einbindung ist willkommen.
Tipps & Tricks
Hier sind ein Paar nützliche Informationen, die beim Benutzen von Python in OOo helfen.
Debug-Ausgabe
Falls Sie ein Python-Skript starten, wird jeder Fehler geräuschlos die Ausführung unterbrechen und es wird schwer sein, Ihre Extension zu debuggen. Um dieses Verhalten zu verändern, kann man das LogLevel ändern.
Schauen Sie in /Pfad/zu/ooo/program/pythonscript.py und ersetzen Sie LogLevel.use = LogLevel.NONE mit LogLevel.use = LogLevel.DEBUG
Es gibt aktuell nicht dokumentierte Umgebungsvariablen, die der PyUNO-Brücke mitteilen, jeden Aufruf mitzuschreiben (loggen). Setzen Sie hierfür die Umgebungsvariable export PYUNO_LOGLEVEL=ARGS , Die Ausgabe ist ein wenig schwer zu lesen, aber sehr hilfreich während der Entwicklung.
Dies gilt für Unix. Für Windows brauchen Sie ein Paar mehr Schalter und die Ausgabe wird in eine Datei (kein stdout auf Windows :-( ) geschrieben.
Einige Fehlermeldungen erscheinen immer noch nicht in diesen Logbüchern. Dies wird in der nahen Zukunft (CWS pyunofixes4) verbessert werden. Sobald der CWS integriert ist, werde ich diese Schalter auf der offiziellen PyUNO-Seite dokumentieren.
Dank an Joerg Budischewski
Python specific information for Extension creation
To create extensions for python is important that you have enough relation with the UNO components as well as packaging your code to be able to easily distribute your scripts through the OpenOffice.org package manager. Please check up the tutorials on how to componentize your code as well as how to deploy remote scripting through a service implementation.
To learn to run Python on Windows you could visit this link for more detail information.
Starten
- Using Python on Windows - Neu in Python? Lernen, wie man Python auf Windows verwendet
- Using Python on Linux - Eine Pflichtlektüre für einen Überblick zu Python und den OOo-Verbindungen
- pyUNO bridge - Offizielle Seite der PyUNO-Brücke auf UDK Seite
- Python as a macro language in OpenOffice.org 2.x - Wie das Python-Skripting-Rahmenwerk benutzt wird
- Einführung in das Testen von PyUNO-Programmen mit doctests
- Erstelle eine dialog box in PyUNO.
- Connect to openoffice.org von PyUNO
- PyUNO samples derzeit mit OpenOffice.org ausgeliefert und die Erklärung dazu.
- Erweitertes Capitalized.py Skript von The gray Cardinal im OOoforum.
PyUNO Modules
- Danny's Python Modules - Collection guide from DannyB's modules.
- PrinttoWriter.py - This makes it easy and convenient to print a bunch of text into a Writer document.
- Developing Calc Funcions in Python - Learn how Python can be used to script your spreadsheets
- Generating a Spreadsheet through Python - Automatically generate new spreadsheets
- Python container components
- PyUNOServer - The PyUNOServer is a script that works as an XML server for OpenOffice.org Calc
- calcParser - calcParser is a small parser using the native SAX utilities within the OpenOffice.org python
- OoConfig - OoConfig is a Python extension that seeks to provide a configuration editing facility similar to Mozilla's about:config
- OOoRISExport.py - Exports the bibliographic database in RIS format. Also RISImport.py
- Zotero Plugin - The Zotero plugin provides citation and bibliographic table insertion and editing functions for Writer documents.
Hacking Arround
- UNO component packaging - How to create UNO components as well as the basics of script componentizing
- Python component to parse XML - Python is great to parse XML, PyUNO is also excellent when working with XML
- Example of Service in Python - Learn how to run Python as a service, this is useful for remote scripting.
- Modify spreadsheet - Example of storing and retrieving a custom attribute on a spreadsheet cell.
- A simple daemon in Python - Learn how to run Python as a daemon
- Loook.py - a simple Python tool that searches for text strings in OpenOffice.org.
- odt2txt.py - convert ODF to plain text using python (and convert the txt to html).