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.
    • Gregg T GeigerG
      Gregg T Geiger
      last edited by

      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.

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank @Gregg T Geiger
        last edited by

        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
        • Claudia FrankC
          Claudia Frank
          last edited by

          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
          • Gregg T GeigerG
            Gregg T Geiger
            last edited by

            Claudia: Your solution works perfectly. Thanks so much!

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