[Scilab-users] Prompt strange behavior in Windows7/Scilex5

Laurent Bonaventure laurent.bonaventure at ac-nantes.fr
Sun Sep 13 19:04:59 CEST 2015


Thank you for your quick answer!

First, about what I want to achieve : I want to interact with a Scilab 
kernel, to which I want to send instructions and get the output 
(including the error messages I guess) in a consistent way. Meaning that 
I should be able to force the kernel (or in my case, its input loop) to 
be in a state where it's able to interpret my commands, whatever errors 
it got from the preceding ones.

But I need a persistent kernel : I want the variables and functions to 
persist from executing a group of commands onto the next one. So I can't 
just throw up a new one every time.

I managed to do all this, but crudely (btw, the idea is not from me) : 
open a single Scilex process with pipes at both ends, send and read, 
with tweaks:
- send only commands garanteed without errors (the other ones are 
encapsulated in a temporary exec file, with a tweak to grab the ans 
value) because errors change the Scilex input ("prompt") state
- getting Scilab to put some marks in the output to better interpret it.

I was elated when I managed to display a plot this way, then near 
despair when I saw I couldn't interact with it by using the graphical 
interface (the -nw switch doesn't have any visible effect).

Note. I have a similar problem when I use the editvar widget.

Right now, I'm running out of ideas to circumvent that problem, so I'm 
trying to understand what causes it. While investigating, I stumbled on 
the strange behavior I described, and that's why I'm trying to 
understand it, in the hope that it will help me solve my bigger problem.

Cheers,
Laurent

- Le 13/09/2015 17:54, Samuel Gougeon a écrit :
> Hello,
> I confirm the behavior that you reported. The graphic windows opened
> with clf is a java one, while the graphical Editor is a Tk one.
> I do not clearly catch what you need, either using Scilab in batch mode
> -- with no interaction, just piping instructions with the -e or -f
> launching options (-->help scilab)--, or with interaction?
> In batch mode, off-screen graphical drivers may be used (-->help driver).
> HTH
> Samuel
>
> Le 13/09/2015 16:41, Laurent Bonaventure a écrit :
>> Hello.
>>
>> I'm experimenting with piping commands through Scilex interactive
>> (with the goal of interfacing it with an IPython Notebook, actually).
>>
>> This is one of my problems: the prompt has a strange behavior as soon
>> as a command gets a delayed error (e.g., the command opens a window in
>> a separate thread; then the windows throws an error). I don't know how
>> to restore the normal behavior.
>>
>> Steps to reproduce (Windows 7, Scilab >= 5.4):
>>
>> 1)launch Scilex (or Scilex -nw)
>> 2)type: clf;
>> 3)A Tk window opens. Fiddle with it to get an error.
>> (E.g.: trying to change the axes (Edit/Axes properties), you get in
>> the console: Error: can't read "wfortree": no such variable)
>> 4)Back to the interactive prompt, press Enter.
>>
>> At that point, the input isn't functioning correctly anymore.
>>
>> - two prompts appear in a row instead of one
>> - the history works correctly
>> - but any commands you type directly won't be displayed at all (and
>> won't be executed except if you press Enter twice, and then strange
>> characters are added to your input)
>>
>> I suppose that all this is already documented, but I can't find
>> anything related to the question (I tried many searches in
>> Google/SO/gmane but without success).
>>
>> Could someone, either point me to the right page, or tell me how to
>> restore the correct behavior without a reset, or better yet, tell me
>> what's happening here?
>>
>> Note. The behavior is correct under the WScilex console, but I have no
>> clue about how to pipe instructions through it / get its output.
>>
>> Thank you.
>> L. B.





More information about the users mailing list