blink1073 / oct2py

Run M Files from Python - GNU Octave to Python bridge
http://blink1073.github.io/oct2py/
MIT License
261 stars 54 forks source link

Sentinel error occurred while executing oct2py in python for running octave script #185

Closed KaranSohal closed 3 years ago

KaranSohal commented 3 years ago

I am trying to use oct2py to run octave script(.m file) in python. here is the code

import os 
os.environ['OCTAVE_EXECUTABLE'] = ('C:\\Program Files\\GNU Octave\\Octave-6.2.0\\mingw64\\bin\\octave-cli.exe')
import oct2py
out = oct2py.Oct2Py()
out.source('main.m')

it runs my .m file and shows the results also but after that I receive following error.

error: 'sentinel' undefined near line 99, column 99
error: called from
    _pyeval at line 99 column 10

whats going wrong here?

KaranSohal commented 3 years ago

So I found out that this error occurs when we have clear all command in our ".m" file

singhtanishq commented 1 year ago

Yes you are right, removing the clear all statement from the above code removed the conflict/error that I was getting but the problem is that the output of the .m file is for few seconds only after few seconds it disappears, I don't know why.