GithubHelp home page GithubHelp logo

Comments (12)

sasumner avatar sasumner commented on June 30, 2024 1

Maybe some interesting related links? :

https://notepad-plus-plus.org/community/topic/13277/pythonscript-show-console-on-error

posting by me here:
https://notepad-plus-plus.org/community/topic/14130/hide-or-toggle-find-results-panel-with-keyboard-command

from pythonscript.

Yaron10 avatar Yaron10 commented on June 30, 2024 1

and its tab activated (if not already, in a multitab situation--I have the Find-result panel and PS Console as multi-tab in a single window) when PS code writes something to the console.

Good point.
👍

from pythonscript.

 avatar commented on June 30, 2024 1

I wasn't clear - if you start a subprocess and try to do something with it, it might return an
output like "not supported with this version". How should a program know this?
What I can think of is that PS treats all messages which are send to stderr as error messages,
but messages sent to stdout should be treated as non-error messages which would mean
if someone is redirecting stdout to stderr it would be seen as error.

from pythonscript.

Yaron10 avatar Yaron10 commented on June 30, 2024

@sasumner,

Thank you for the links.

So I'm not the first user addressing this issue.
I think it would be good to integrate this option in PS (with or w/o a user preference).

from pythonscript.

sasumner avatar sasumner commented on June 30, 2024

I fully support this issue. In addition, I would like to see the PS Console opened (if not already) and its tab activated (if not already, in a multitab situation--I have the Find-result panel and PS Console as multi-tab in a single window) when PS code writes something to the console. This is typically in the form of a "print" statement but could be any console write. I'm not sure if this kind of thing "burdens" the plugin too much at runtime...

from pythonscript.

Yaron10 avatar Yaron10 commented on June 30, 2024

but could be any console write

If you mean any console.write() in a script, I think it should depend on a (separate) user-preference.

from pythonscript.

sasumner avatar sasumner commented on June 30, 2024

@Yaron10 , maybe so...maybe so... :)
As always, with software things get complicated fast...deserves some well-thought-out design!

from pythonscript.

Yaron10 avatar Yaron10 commented on June 30, 2024

Opening/activating the console on error can be implemented even without a user-preference IMO.
console.write() in a script is fundamentally different and should therefore depend on a user-preference.

Anther option: console.write() can have another parameter activateConsloe defaulted to false.

from pythonscript.

 avatar commented on June 30, 2024

But what is an error? Traceback messages only? Python syntax errors? Errors from a external process?
Messages written with writeError function? Raise calls might be or might be not an error ... ?

from pythonscript.

Yaron10 avatar Yaron10 commented on June 30, 2024

Any error message not initiated directly by the user.

If implemented, flashing NPP window can be a nice addition.
And console.writeError() (like console.write()) can have another parameter activateConsloe defaulted to false.

from pythonscript.

Yaron10 avatar Yaron10 commented on June 30, 2024

I've never tried starting a sub-process nor am I fully familiar with redirecting stdout to stderr.
So I believe your suggestion is clever as always. :)

Thank you.

from pythonscript.

sasumner avatar sasumner commented on June 30, 2024

Maybe the low-hanging fruit is best dealt with first. Many times I run a script and something unexpected happens, and my editor tab text doesn't change as I expect, and I am left wondering...because the PS Console is not currently being shown. When I then show the PS console I see something like this:

Traceback (most recent call last):
File "", line 1, in
NameError: name 'a' is not defined

So as a first pass, I would think that anytime a "traceback" is generated, the PS console should be shown to the user if not currently visible.

I think trying to catch things like this example with this kind of feature is a bit ambitious: ...start a subprocess ...it might return an output like "not supported with this version".

from pythonscript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.