Post by Almar KleinHow can your return from a script? You can only return from a function. In
Post by Almar KleinMatlab you have one file per function. In Python you can define multiple
functions in a module. If you want to be able to return early, write your
code as a function.
Call it however you want. In latex for example this is called â\endinputâ
IPython is not python, itâs an interactive console, so there is nothing
wrong in saying that a script should terminate mid-length. What I am saying
is that people using matlab will rely heavily on this feature when
prototyping, and that this feature is completely missing.
a portion of the script by running the cell.
interpreter. Therefore this does not work when used in the editor itself.
anymore, and could only run via an IPython interpreter.
PYTHONPATH (i.e. in the shell config), the directory of the script (if
the star on a starred directory for the menu where you can activate it).
Post by Almar KleinMPL is that MATLAB provides everything: UI, math libraries and IDE. If pyzo
is to become a market leader it is your responsibility to make sure that
MATLAB users donât get frustrated when moving to pyzo. The developer of MPL
cannot understand/see these issues, so itâs Pyzo-devs that need to lobby
the MPL-devs to get things done properly.
small children. Although I try hard to make a great tool, because I believe
away all frustrations for Matlab users. Learning a new language and the
associated tools takes time, no matter how easy it will be made for you.
Post by Almar KleinThanks for your comments. Please keep in mind that Python is not Matlab.
Post by Almar KleinSome things work differently. I agree that a smooth transition is
desirable, but Python/*Pyzo should not try to be exactly like Matlab*.
You would need to adjust your workflow a little :)
I perfectly agree, Pyzo should steal from Matlab everything that works
well and forget the rest. I did adjust my workflow but it was quite a
substantial adjustment. The smallest the adjustment the more likely people
will transition from Matlab to Pyzo!!
I have been really annoyed by mathworks, my patience is now exhausted.
Post by Almar KleinHow can your return from a script? You can only return from a function.
In Matlab you have one file per function. In Python you can define multiple
functions in a module. If you want to be able to return early, write your
code as a function.
Call it however you want. In latex for example this is called â\endinputâ
IPython is not python, itâs an interactive console, so there is nothing
wrong in saying that a script should terminate mid-length. What I am saying
is that people using matlab will rely heavily on this feature when
prototyping, and that this feature is completely missing.
For example, as far as I can see I cannot put any IPython commands
directly in the script⊠this could surely be possible?
The \endinput function could then be just an IPython command
Post by Almar KleinYou may want to start using the ârun file as a scriptâ. It will change
the folder path to the path of the script, it will give you a fresh
interpreter (equivalent to clearing all variables). You can also ``del x,
y`` to delete individual variables.
Yes, I have noticed that. I found it very counter-intuitive that ârun main
fileâ and ârun file as a scriptâ perform very different actions. For
example the first doesnât update the execution folder, while the first
does!!! (I spent an hour trying to understand why my script couldnât find a
function in the same folder, and as I was used to Matlab, where folders are
always changed to the path containing the executed script, this was
___very___ frustrating).
Post by Almar KleinPost by Andrea Tagliasacchithere is no âpath_toolâ?
What is a path tool? Pyzo does have a pretty handy file explorer.
This is used to tell the python interpreter where to look for what you
call âmodulesâ. From what I can see now the only path I can specify is the
one under the âEdit shell configurationâ.
Post by Almar KleinPost by Andrea Tagliasacchithere is no âdbstop if errorâ (I found something in iPython but doesnât
work as advertisedâŠ)
There is something better. After an error has occurred, you can enter
debug mode using shell > post-mortem debug. For optimal usability, bind
this to e.g. CTRL-P.
Alright, I will take a look next time.
Post by Almar KleinThere is. But maybe not in Matplotlib? You can certainly do it in Qt,
which is the preferred tool for creating (advanced) user interfaces. You
can create some GUI stuff with Matplotlib, but its naturally limited.
Fair enough, itâs mostly a missing core feature of Matplotlib.
Post by Almar KleinPost by Andrea Tagliasacchithere is no âmovegui(âeastâ), etcâŠ
Not sure what this should do. There is not (and should not be) a way to
change the position of the IDE from within Python, because the interpreter
runs in a subprocess of the IDE (which is why it can be restarted, and can
have multiple instanced, etc.). If you mean to change the position of a GUI
element, you can certainly do this with Qt. Not sure about MPL.
This changes the position of a figure, so that you can re-execute a script
fresh and not have to bring figures in the front and re-position them
manually. Again, it should be a matplotlib add-on, but itâs very easy to
start a blame-game and having pyzo and mpl blaming each other for what is
broken/buggy/missing.
Post by Almar KleinPost by Andrea Tagliasacchiwhen creating a figure, it is created in the background (although this
happens also in matlab unless you âclose allâ)
Yeah, this can be annoying. This is one of the few downsides of the fact
that the interpreter runs in a separate process. Not much we can do about
that as far as I know.
I found a trick, but this is ugly and relies on Qt being the backend,
get_current_fig_manager().window.raise_()
The reasons for which I donât think you should ignore problems related to
MPL is that MATLAB provides everything: UI, math libraries and IDE. If pyzo
is to become a market leader it is your responsibility to make sure that
MATLAB users donât get frustrated when moving to pyzo. The developer of MPL
cannot understand/see these issues, so itâs Pyzo-devs that need to lobby
the MPL-devs to get things done properly.
Note all I am saying is in Pyzoâs best interest. I am currently evaluating
whether to adopt python/matlab or whether I should stick to MATLAB for my
Sepâ16 class⊠Anything I do in Pyzo should âjust workâ.
Wish you all the best
â ataiya