Added linux LibreOffice wrapper information to docs

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
Ian Bell
2014-10-27 19:44:39 -04:00
parent 0485db0d18
commit 0812653a27
3 changed files with 43 additions and 3 deletions

View File

@@ -0,0 +1,16 @@
from CoolProp import CoolProp as cp
from CoolProp import __version__ as cpv
from CoolProp import __fluids__ as cpf
from sys import version
def cpversion():
return cpv
def props(cp1,cp2,cp3,cp4,cp5,cp6):
return cp.Props(cp1,cp2,cp3,cp4,cp5,cp6)
"""if __name__=='__main__':
print props('P','T',300,'Q',1,'Propane')
"""

View File

@@ -5,8 +5,32 @@
LibreOffice Wrapper
*******************
Windows using DLL (shared library)
----------------------------------
A very simple example can be found here: :download:`TestLibreOffice.ods`. You will need to download the release 32-bit __stdcall shared library for windows from :sfdownloads:`sourceforge <shared_library/Windows/32bit__stdcall_calling_convention>` or from :bbbinaries:`the development server <shared_library/Windows/32bit__stdcall_calling_convention>`. Place the downloaded DLL in c:\\CoolProp
.. warning::
This only works on windows. There is currently no easy way to call shared libraries from linux or OSX.
Linux using python
------------------
1. You will need two files - :download:`coolprop.py` and :download:`TestLibreOfficePy.ods`
2. At the command prompt do something like::
# Make a folder for the script to reside in
mkdir -p ~/.config/libreoffice/4/user/Scripts/python/
# Copy the dowloaded .py file to the folder you made (adjust download path as necessary)
cp ~/Downloads/coolprop.py ~/.config/libreoffice/4/user/Scripts/python/
# Install python script provider (uses python 3)
sudo apt-get install libreoffice-script-provider-python
# pyton scripting in LibreOffice uses python3, make sure we populate the right python site-packages folder
sudo apt-get install python3-pip
sudo pip3 install Cython
# Compile CoolProp v5+ manually
# you need to have numpy and matplotlib already - you can do sudo apt-get install python3-matplotlib
git clone http://github.com/CoolProp/CoolProp --recursive
cd CoolProp/wrappers/Python
sudo python3 setup.py install
3. Open example in LibreOffice