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
Any help much appreciated
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
Please sign in to leave a comment.
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.
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
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: