mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-01-22 12:28:04 -05:00
Added linux LibreOffice wrapper information to docs
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
BIN
Web/coolprop/wrappers/LibreOffice/TestLibreOfficePy.ods
Normal file
BIN
Web/coolprop/wrappers/LibreOffice/TestLibreOfficePy.ods
Normal file
Binary file not shown.
16
Web/coolprop/wrappers/LibreOffice/coolprop.py
Normal file
16
Web/coolprop/wrappers/LibreOffice/coolprop.py
Normal 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')
|
||||
|
||||
"""
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user