hanya wrote:The shipped python.exe (placed in the program directory, not in the python-core-version\bin) with the OOo sets a few environment variables to work correctly.
"PATH" for to find libpyuno.so file and load it to work. "URE_BOOTSTRAP" is used to load UNO components. "UNO_PATH" is used to start OOo, this variable is optional, I think.
I found that under windows the
libpyuno.so is renamed in c:\programmi\OpenOffice.org 3\Basis\program\
pyuno.pyd
hanya wrote:
You can know these variables on your python like the following code:
Code: Select all
import os
print(os.environ['PATH'])
print(os.environ['URE_BOOTSTRAP'])
print(os.environ['UNO_PATH'])
I can connect to OOo through another python installation with these variables.
Here is what I did (thanks very much hanya for help!)
1. installed ooo3
2. installed the official python 2.6.4 to
c:\python26
3. configured the windows environment ADDING the variables
URE_BOOTSTRAP and
UNO_PATH and modifying the
PATH variable as follows :
Code: Select all
URE_BOOTSTRAP vnd.sun.star.pathname:C:\Programmi\OpenOffice.org 3\program\fundamental.ini
UNO_PATH C:\Programmi\OpenOffice.org 3\program\
PATH C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\python26;C:\Programmi\OpenOffice.org 3\URE\bin;C:\Programmi\OpenOffice.org 3\Basis\program;c:\GTK2\bin;c:\GTK2\lib;
4. Added a .pth file in
c:\python26\Lib\site-packages\uno.pth with the following content :
Code: Select all
c:\\programmi\\OpenOffice.org 3\\Basis\program
Now I can launch my gtk apps with pythonw.exe and import the uno module
Simone