python with ca

(old logo) ca - tools with python

Python needs to be installed ;-)

epics@sioc-2:~$ sudo install python [sudo] password for epics: Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python-minimal python2.7 python2.7-minimal Suggested packages: python-doc python-tk python2.7-doc binfmt-support The following NEW packages will be installed: libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python python-minimal python2.7 python2.7-minimal 0 upgraded, 7 newly installed, 0 to remove and 6 not upgraded. Need to get 3,877 kB of archives. ... must be installed: epics@sioc-2:~$ sudo apt install python-pip Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: build-essential -dev fakeroot libalgorithm-diff- libalgorithm-diff-xs-perl libalgorithm-merge-perl libdpkg-perl libexpat1-dev libfakeroot libfile-fcntllock-perl libpython-all-dev libpython-dev libpython2.7 libpython2.7-dev python-all python-all-dev python-dev python-pip-whl python-pkg-resources python- python-wheel python2.7-dev Suggested packages: -keyring python-setuptools-doc ... pyepics must be installed:

epics@sioc-2:~$ pip install pyepics Collecting pyepics Downloading https://files.pythonhosted.org/packages/d6/d2/3b09b70094ff9b1ef2f1e7 8f51a5eba7547597e784b99dab6cd1a5fe4170/pyepics-3.3.1..gz (4.2MB) 100% |████████████████████████████████| 4.2MB 428kB/s Building wheels for collected packages: pyepics Running setup.py bdist_wheel for pyepics ... done Stored in directory: /home/epics/.cache/pip/wheels/5b/46/fd/c35e7b76167977eec95b 1793a66a3c591ab42eac58632e1dd8 Successfully built pyepics Installing collected packages: pyepics Successfully installed pyepics

A Environment variable must be set:

export PYEPICS_LIBCA=/home/epics/EPICS/epics-base/lib/-x86_64/libca.so

Now python can be used in the usual way:

epics@sioc-2:~$ python Python 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from epics import caget, caput >>> m1 = caget('epics:calcExample') >>> print m1 8.0 >>> See : http://cars9.uchicago.edu/software/python/pyepics3/overview.html#quick-start