On Wed, 17 Jan 2007, Tiziano_mk wrote:
> Al Boldi wrote: > > Tiziano_mk wrote: > > > I wish to add this missing item that i find more interesting: > > > > > > "Maybe you want to use python to control OpenOffice with Free pascal?" > > > It's possible, just embed FPC with the python "embedded" in OpenOffice. > > > > > > During holydays I made successfully this test (on windows) and I am > > > still investigating on the details. > > > > > > Sorry but by now I don't have documentation, work is in progress, if > > > someone is interested (and this thread shows how few people is > > > interested in this matter) I can give further details. > > > > Can you give further details? > > > > > > ok, I try to give a brief overview, here I talk of FPC but read that as > FPC/Lazarus, please: > > look at the Python Documentation: Extending and Embedding > (http://docs.python.org/ext/ext.html) > > This chapter explains the ways to use python with other applications, it is > C/C++ based but it is simple to translate all that in Pascal. > > Here you can see the concepts of Extending python with C/C++/FPC and Embedding > python in C/C++/FPC. > > With this in mind you have not to port Python for Delphi to Lazarus, you can > simply build a suite of (simple) units that make up the interface with the > pythonxx.dll or pythonxx.so libraries, and this is possible respecting the > multiplatform requirements of FPC. > > Now, since you can easily launch python scripts or modules from an application > compiled with FPC it is also possible to bind this application with the > pythonxx.dll that OpenOffice installs with its binaries. This is an ordinary > python distribution integrated with modules that interface python with the OO > APIs. > > Now you need to look at PyUno documentation > (http://udk.openoffice.org/python/python-bridge.html). > Here you can see how to use Python and the Python-UNO bridge to issue commands > to OpenOffice. > > With FPC you can only excecute the python Uno Bridge outside of the OpenOffice > process, this is a bit slow, but it is enough to launch from FPC a simple > helloworld.py that opens an OOWriter document and writes in the document the > usual "HelloWorld!" string (I tested this on Windows, and I have to test if it > really works also on Linux). > > (note: Issuing commands to OpenOffice can be easily done with Delphi, this is > explained in the OpenOffice SDK, but it uses the Uno OLE automation bridge. > Since OLE and COM is not available in other platforms, FPC doesn't support > them, so, this approach is not available for it) OLE and COM are supported in FPC, but only on Windows. So in theory you can automate OOo directly on Windows. IMHO a OOo interface should use OLE/COM on windows, and any other means (for example python) on other platforms. Although I think that if python can call openoffice, FPC should be able to do the same. Michael. _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives