This Jupyter notebook should be used in conjunction with pypeincoming.ipynb.
Run through the following cells...
In [1]:
import os, sys
sys.path.append(os.path.abspath('../../main/python'))
In [2]:
import random
import numpy as np
import thalesians.tsa.pypes as pypes
In [3]:
pype = pypes.Pype(pypes.Direction.OUTGOING, name='EXAMPLE', port=5758); pype
Out[3]:
In another window, run pypeoutgoing.ipynb up to and including the line for x in pype: print(x). Then send some of the following values — they will be sent over the "pype" — and watch them printed in the pypeoutgoing.ipynb window:
In [7]:
pype.send('Hello World!')
In [8]:
pype.send(np.array(random.uniform(0., 100)))
In [11]:
pype.send(np.array([random.uniform(0., 100), random.uniform(0., 100)]))
Once you have finished experimenting, you can close the pype:
In [12]:
pype.close()
The for x in pype: print(x) loop in the pypeincoming.ipynb window will then exit.