Community
    • Login

    I need help trying to run Python in Notepad++

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 2 Posters 12.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.
    • David TinocoD
      David Tinoco
      last edited by

      Hello folks,

      I am new to the world of scripting and specially new to Notepad++, I am currently trying to execute python on notepad++ I get the following error: ; about to start a child process: ; about to start a child process: “C:\Users\AEON SOUNDWORKS\AppData\Local\Programs\Python\Python37\python.exe” FirstProgram.py""
      CreateProcess() failed with error code 193:
      %1 is not a valid Win32 application.

      This is driving me crazy as I have no idea on what to do.

      Thanks in advance,

      David

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank @David Tinoco
        last edited by Claudia Frank

        @David-Tinoco

        How exactly did you try to run the script?
        Which version of npp are you using? (Debug-Info under ? menu)
        Some hints how it can be achieved are here.

        Cheers
        Claudia

        David TinocoD 1 Reply Last reply Reply Quote 0
        • David TinocoD
          David Tinoco @Claudia Frank
          last edited by

          @Claudia-Frank Hi Claudia, thanks for getting back to me. I am using this version: Notepad++ v7.5.6 (64-bit)
          Build time : Mar 19 2018 - 00:23:17
          Path : C:\Program Files\Notepad++\notepad++.exe
          Admin mode : OFF
          Local Conf mode : OFF
          OS : Windows 10 (64-bit)
          Plugins : DSpellCheck.dll mimeTools.dll NppConverter.dll NppExec.dll

          And I am trying to run the script the same way this guy does it on the video: https://www.youtube.com/watch?v=OS5BBSqon3E

          Cheers,

          David

          Claudia FrankC 1 Reply Last reply Reply Quote 0
          • Claudia FrankC
            Claudia Frank @David Tinoco
            last edited by

            @David-Tinoco

            Hi David,

            I assume the way you provide the python interpreter to NppExec is causing the issue.

            Your path contains a space between AEON and SOUNDWROKS correct?
            If so take care that the complete path is encased by double quotes otherwise
            NppExec would try to start a program C:\Users\AEON with paramaters SOUNDWORKS\AppData\Local\Programs\Python\Python37\python.exe” FirstProgram.py“

            Note, when running the program with NppExec your current working directory is the one where notepad++.exe is,
            so you cannot just provide the python script name unless you have saved it under the same directory.
            In your example, NppExec would try to find FirstProgram.py under the same directory where npp executable is.

            I would define it like this

            cd "C:\Users\AEON SOUNDWORKS\AppData\Local\Programs\Python\Python37"
            python "$(FULL_CURRENT_PATH)"
            

            Save it with a meaningful name and execute it the first time by pressing F6 and every other execution by pressing CTRL+F6

            NppExec would change the current working directory to …\Python37 and then would call python with the full path of the
            current file provided as parameter. Of course, the current document must have been saved.

            I hope this makes sense to you.

            Cheers
            Claudia

            1 Reply Last reply Reply Quote 2
            • David TinocoD
              David Tinoco
              last edited by

              Hey Claudia,

              Thank you so much, it works now :). I feel like a complete hackerman now haha :).

              Have a lovely day.

              Regards,

              David

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