[Scilab-users] Scilab API sciprint to print on the same line

Samuel Gougeon sgougeon at free.fr
Wed Dec 11 21:09:25 CET 2019


Le 11/12/2019 à 14:31, Chin Luh Tan a écrit :
> Hi,
>
> I am trying to print some progress of a for loop in C api which will 
> print the output in scilab console using the sciprint.
>
> Is there anyway to print the output to a same line as normal C printf 
> could be achieved using '\r' ?
>
> e.g.:
>
> currently my out out showing:
>
> Train Epoch: 10 [ 1000/15416] Loss: 0.5961
> Train Epoch: 10 [ 2000/15416] Loss: 0.6794
> Train Epoch: 10 [ 3000/15416] Loss: 0.3965
> Train Epoch: 10 [ 4000/15416] Loss: 0.8110
> Train Epoch: 10 [ 5000/15416] Loss: 0.7892
>
> I would like to have the output to show on the same line.
>
> I tried \r with fflush(stdout) it seems not working.
>
> Thanks.
>
> rgds,
> Chin Luh


In the C API i don't know, but in Scilab language, this mprintf("..\r") 
feature is broken <http://bugzilla.scilab.org/show_bug.cgi?id=14642>.

It is possible to mimik it with (example):

for  i  =  1:100
     mprintf("Static counter: %d\n \n\n",i)
     sleep(300)
     clc(1)
end Samuel


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20191211/3f8e5a73/attachment.htm>


More information about the users mailing list