Python 2.6/2.7, pyuno and Apache OpenOffice (AOO)

I'm looking at python scripting for Apache OpenOffice, and thought I'd ask some questions here to save time in case someone has already been down this route.

AOO bundles Python 2.6.1

  • Does anyone know where I can download Windows binaries for Python 2.6.1?
  • Can I use PyCharm to run Python 2.6.1 and Python 2.7 side by side? I'd like 2.7 to be the default, but develop for AOO using 2.6.1
  • Any hints at all about pyuno in PyCharm
  • Any hints at all about using PyCharm for AOO

Any help much appreciated
3 comments
Comment actions Permalink
I personally use LibreOffice (LO) not AOO, but as LO was forked from OOo back in 2010 many things are still similar if not identical.

With a LO installation in Windows, assuming I include the python-uno bridge then a 2.6.1 python.exe gets installed along with other .py, .dll and .pyd files.

Here is a small piece (i.e. there is a lot more) of what I see under the C:\Program Files (x86)\LibreOffice 3.6\program directory:

09/07/2012  09:46 AM    <DIR>          python-core-2.6.1 08/21/2012  11:39 PM            11,264 python.exe 08/22/2012  05:03 AM         2,248,192 python26.dll 08/22/2012  05:09 AM             7,024 pythonloader.py 08/22/2012  05:03 AM            27,136 pythonloader.uno.dll 08/22/2012  05:12 AM171 pythonloader.uno.ini 08/21/2012  11:39 PM           463,872 pyuno.pyd

For a quick get your feet wet solution, in PyCharm create a new project and then via File \ Settings add that python.exe (noted above) as your Python interpreter.  Will take a moment to build the skeletons and then you should be good to go.

Each project has a single interpreter, so you can't do 2.6 and 2.7 side by side.  Think of it like this, how could auto-complete know what to do?  That being said, if you play some games with virtualenv you can come close, though I am not sure why in this case you'd want to.

As for hacking python-uno, best of luck to you.
0
Comment actions Permalink
Forgot to answer your original question — python.org has links to all their "production" releases.  Here is where you can grab Python 2.6.1

http://www.python.org/download/releases/2.6.1/

If you do install that older release, you'll have to install the pyuno goodies yourself.

Cheers
0
Comment actions Permalink
Thanks Rob,

I added the AOO python.exe as the project interpreter and got a few of
the examples working.

I'm not quite sure why I'm trying to hack pyuno, advanced masochism
possibly!

Cheers
Jim

On 25/09/2012 14:54, Rob Weigel - PyCharm wrote:

*PyCharm <http://forum.jetbrains.com/forum/PyCharm> * > *Python
2.6/2.7, pyuno and Apache OpenOffice (AOO)
<http://forum.jetbrains.com/thread/PyCharm-1122> * [ *pyuno
<http://forum.jetbrains.com/tag/PyCharm-pyuno> * + *aoo
<http://forum.jetbrains.com/tag/PyCharm-aoo> * ] 9:54 am
<http://forum.jetbrains.com/thread/PyCharm-1122?message=PyCharm-1122-1> Rob
Weigel <http://forum.jetbrains.com/user/sedtnrob>

I personally use LibreOffice (LO) not AOO, but as LO was forked from
OOo back in 2010 many things are still similar if not identical.

With a LO installation in Windows, assuming I include the python-uno
bridge then a 2.6.1 python.exe gets installed along with other .py,
.dll and .pyd files.

Here is a small piece (i.e. there is a lot more) of what I see under
the C:\Program Files (x86)\LibreOffice 3.6\program directory:

09/07/2012 09:46 AM <DIR> python-core-2.6.1 08/21/2012 11:39 PM 11,264
python.exe 08/22/2012 05:03 AM 2,248,192 python26.dll 08/22/2012 05:09
AM 7,024 pythonloader.py 08/22/2012 05:03 AM 27,136
pythonloader.uno.dll 08/22/2012 05:12 AM 171 pythonloader.uno.ini
08/21/2012 11:39 PM 463,872 pyuno.pyd

So in PyCharm create a new project and then via File \ Settings add
that python.exe as your Python interpreter. Will take a moment to
build the skeletons and then you should be good to go.

Each project has a single interpreter, so you can't do 2.6 and 2.7
side by side. Think of it like this, how could auto-complete know what
to do? That being said, if you play some games with virtualenv you can
come close, though I am not sure why in this case you'd want to.

As for hacking python-uno, best of luck to you.

     Jaffa McNeill <http://forum.jetbrains.com/user/jaffamcneill> @ Sep
     24 <http://forum.jetbrains.com/thread/PyCharm-1122>

     I'm looking at python scripting for Apache OpenOffice, and thought
     I'd ask some questions here to save time in case someone has
     already been down this route.

     AOO bundles Python 2.6.1

       * Does anyone know where I can download Windows binaries for
         Python 2.6.1?
       * Can I use PyCharm to run Python 2.6.1 and Python 2.7 side by
         side? I'd like 2.7 to be the default, but develop for AOO
         using 2.6.1
       * Any hints at all about pyuno in PyCharm
       * Any hints at all about using PyCharm for AOO


     Any help much appreciated
0

Please sign in to leave a comment.