On Fri, Apr 6, 2012 at 10:09 PM, Glenn Ramsey <span dir="ltr">&lt;<a href="mailto:glenn.ramsey@slidespeech.com">glenn.ramsey@slidespeech.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div class="im">On Fri, Apr 6, 2012 at 7:32 PM, Miklos Vajna <span dir="ltr">&lt;<a href="mailto:vmiklos@suse.cz" target="_blank">vmiklos@suse.cz</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

On Fri, Apr 06, 2012 at 09:05:29AM +1200, Glenn Ramsey &lt;<a href="mailto:glenn.ramsey@slidespeech.com" target="_blank">glenn.ramsey@slidespeech.com</a>&gt; wrote:<br>
&gt; with OOoPython on the command line (in OSX 10.6) I discovered that the<br>
&gt; PYTHONPATH needs to be set up properly before uno can be successfully<br>
&gt; imported.<br>
&gt;<br>
&gt; Is there a way to automatically set this up, or do I have to write<br>
&gt; something in my script to discover and configure the path? I would like<br>
&gt; this to work on Linux, Windows and OSX.<br>
<br>
I just checked the Linux RPM&#39;s, there program/python file is a shell<br>
script setting up PYTHONPATH and friends, then the real python binary is<br>
called python.bin. Maybe you missed this. :)<br></blockquote><div><br></div></div><div>No, I hadn&#39;t checked that, thanks for the tip. On Debian based systems I think it also works out of the box. I tested Windows 7 today and that too works without any further effort. So it looks like it is just OSX that requires additional configuration.</div>
</div></blockquote><br><div>In order for a system python script to be able to execute lo-python it needs to know where LO is installed and what platform it is running on. I hacked up code that does this on Windows by looking in the registry for soffice.exe, but before I start implementing it for other platforms I thought I should check that I&#39;m not reinventing the wheel. Does anyone know of some code that already does this? It doesn&#39;t have to be in Python.<br>
<br>Glenn<br><br></div></div>