Community
    • Login

    Scripts from Notepad++ do not run in Python/Jupyter 3.5(already read prior help discussions)

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    24 Posts 3 Posters 20.4k Views 3 Watching
    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.
    • Claudia FrankC Offline
      Claudia Frank @scott grossberg
      last edited by Claudia Frank

      @scott-grossberg

      Scott, we can get this work in maybe 2-3 posts if you would describe step by step what you do
      instead of writing “I did what you do”, because any slight modification could break it.

      What do you want to do?
      I assume you want to run python with the current script you have open with notepad++.
      What do you use to execute the script?
      I assume you use the Run dialog from the run menu and not the nppexec plugin.
      I would suggest you use the nppexec plugin.

      • Find out where your python.exe is located. We need to know the directory.

      • Press F6 to open the nppexec dialog

      • put the the following into the dialog opened by pressing F6

        cd PATH_OF_THE_DIRECTORY_WHERE_YOUR_PYTHON_EXE_IS
        python “$(FULL_CURRENT_PATH)”

      • Press ok

      A console opens and either shows the expected result or an error.
      If an error appears copy it and post it then we see what is going on.
      Do not interpret it - copy the real output.
      If there is sensitive data in it - replace it with question marks - but only that part.

      Cheers
      Claudia

      1 Reply Last reply Reply Quote 0
      • cmeriauxC Offline
        cmeriaux
        last edited by

        @scott-grossberg as you are a beginner, I suggest you to remove Anaconda and install the official python https://www.python.org/

        1 Reply Last reply Reply Quote 0
        • cmeriauxC Offline
          cmeriaux
          last edited by

          Here is my solution.

          1. uninstall anaconda

          2. install python 3.6 in c:\python36

          3. do an “hello world” script to test
            4 append to the end of script os.system(“pause”) in order to pause your script and be able to read the result

            import os
            print(“Hello World”)
            os.system(“pause”)

          5 run your script with “notepad++ run” command

          C:\python36\python.exe "$(FULL_CURRENT_PATH)"
          

          Here is what i got
          screenshot

          1 Reply Last reply Reply Quote 0
          • cmeriauxC Offline
            cmeriaux
            last edited by

            @scott-grossberg any news ?

            1 Reply Last reply Reply Quote 0
            • scott grossbergS Offline
              scott grossberg
              last edited by

              I followed your suggestion of removing anaconda and installing python directly and I can run notepad++ scripts in python (I tested this with the hello world program). Unfortunately the class that I am using this for has extra formatting in the scripts since they were saved as a python notebook. Therefore I get an error message when I try to run these scripts with notepad++ with my current set up. This is the error message:

              C:\Anaconda\python.exe “C:\Users\scott grossberg\Downloads\controlflow_demo_test”
              Process started >>>
              Traceback (most recent call last):
              File “C:\Users\scott grossberg\Downloads\controlflow_demo_test”, line 21, in <module>
              “execution_count”: null,
              NameError: name ‘null’ is not defined
              <<< Process finished. (Exit code 1)

              I placed the command below into the run box (I saved Anaconda to C:\Anaconda) as well as within the box when I hit the f6 key and it successfully runs the hello world program above in python and the lower console box respectively:

              C:\Anaconda\python.exe “$(FULL_CURRENT_PATH)”

              Do you know how I can get the notepad++ script to run in the jupyter notebook?

              Thank you very much for the help.

              Scott

              Thank you very much for the help.================ READY ================

              1 Reply Last reply Reply Quote 0
              • scott grossbergS Offline
                scott grossberg
                last edited by

                I should have mentioned in the above post that after I successfully installed and tested the notepad++ and the python 3.6 integration I removed python 3.6 and re-installed Anaconda. I did this to try to get notepad++ to run the scripts in the python notebook rather than directly on python.

                I greatly appreciate all of your help.

                Scott

                Scott

                1 Reply Last reply Reply Quote 0
                • cmeriauxC Offline
                  cmeriaux
                  last edited by

                  Sorry I don’t know Jupiter and I didn’t understood your issue.

                  1 Reply Last reply Reply Quote 0
                  • scott grossbergS Offline
                    scott grossberg
                    last edited by

                    I greatly appreciate your help as you showed me how to integrate notepad++ and python.

                    Does anyone know how to run notepad++ scripts in python/ jupyter?

                    Claudia FrankC 1 Reply Last reply Reply Quote 0
                    • Claudia FrankC Offline
                      Claudia Frank @scott grossberg
                      last edited by

                      @scott-grossberg

                      Jupyter as the successor of IPython?
                      If so, isn’t it just a better python shell??
                      So copy and paste should work - but I assume you want to do something different.

                      Cheers
                      Claudia

                      1 Reply Last reply Reply Quote 0
                      • cmeriauxC Offline
                        cmeriaux
                        last edited by

                        You should keep original Python then install Jupyter with ‘pip installer’ that is provided with python

                        http://jupyter.org/install.html
                        
                        1 Reply Last reply Reply Quote 0

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors