• Login
Community
  • Login

Console Window Python Error Parsing Using NppExec

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
4 Posts 2 Posters 3.9k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G
    Gregg T Geiger
    last edited by Dec 24, 2015, 2:09 PM

    Coming from Programmer’s Notepad and Sublime - accustomed to being able to double-click the error message in the output console to jump to line in code generating the error. Trying to use NppExec to yield same effect in Notepad++. The examples for this type of functionality seem to be limited to parsing gcc type output and I can’t seem to make the jump to correctly parsing corresponding Python error messages.

    Specifically, I’d like to parse a line like the following:
    Traceback (most recent call last):
    File “Main.py ”, line 15, in <module>
    start = foo()
    AttributeError: ‘module’ object has no attribute ‘foo’

    Trying something like %FILE%, %LINE% in NppExec yields
    "C:\File “Main.py ” doesn’t exist. Create it?

    What would be an appropriate NppExec highlight mask to allow me to double click the “line 15” output to jump to Line 15 in the code?

    Thanks.

    C 1 Reply Last reply Dec 25, 2015, 1:50 AM Reply Quote 0
    • C
      Claudia Frank @Gregg T Geiger
      last edited by Dec 25, 2015, 1:50 AM

      Hello Gregg-T-Geiger,

      you need to match the line and replace the filename and the linenumber with %FILE% and %LINE%
      So something like

      File “%ABSFILE%”, line %LINE%,

      Cheers
      Claudia

      1 Reply Last reply Reply Quote 0
      • C
        Claudia Frank
        last edited by Dec 25, 2015, 6:41 PM

        I always forget that there are some markdown chars which need to be considered.

        this line

        File “%ABSFILE%”, line %LINE%,
        

        should be

        *File "%ABSFILE%", line %LINE%,*
        

        Sorry for inconvenience
        Claudia
        Claudia

        1 Reply Last reply Reply Quote 0
        • G
          Gregg T Geiger
          last edited by Dec 26, 2015, 7:20 PM

          Claudia: Your solution works perfectly. Thanks so much!

          1 Reply Last reply Reply Quote 0
          3 out of 4
          • First post
            3/4
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors