bastibe / transplant

Transplant is an easy way of calling Matlab from Python
https://transplant.readthedocs.io
Other
108 stars 26 forks source link

python 2.7 compatability #56

Closed DaanVanHauwermeiren closed 7 years ago

DaanVanHauwermeiren commented 7 years ago

following error occurs when installing transplant in a python 2.7 environment

import transplant
matlab = transplant.Matlab()
# call Matlab functions:
length = matlab.numel([1, 2, 3])
magic = matlab.magic(2)
spectrum = matlab.fft(numpy.random.randn(100))
# inject variables into Matlab:
matlab.signal = numpy.zeros(100)
  File "/home/jos/anaconda/envs/PBM_testing/lib/python2.7/site-packages/transplant/transplant_master.py", line 124
    print(line.decode(), end='')
                            ^
SyntaxError: invalid syntax

This example code snippet runs just fine in python 3.5

transplant version: 0.8.1 for python 2.7 0.8.2 for python 3.5

bastibe commented 7 years ago

Transplant is not compatible with Python 2.7.

DaanVanHauwermeiren commented 7 years ago

missed that part in the readme, my bad!