Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Run Path reset when close notepad++

    General Discussion
    2
    8
    176
    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.
    • RA Melis
      RA Melis last edited by

      notepad++ doesn’t save run path when it is closed. So have to reenter it each time open notepad++

      1 Reply Last reply Reply Quote 0
      • Ekopalypse
        Ekopalypse last edited by

        @RA-Melis

        Is this what you’re referring to?

        3ef06fd3-3dfd-4523-b022-a098466e0ae0-image.png

        And you pressed save and it did not appear in the run menu?

        1 Reply Last reply Reply Quote 2
        • RA Melis
          RA Melis last edited by

          Thanks EKO,
          yes by entering C:\PythonPrograms\Python\Python38-32\python.exe -i “$(FULL_CURRENT_PATH)”

          When I save only get shortcut to program a key sequence

          Then when I close notepad++ and reopen the above python path is no longer there with blank entry as you show above so have to re-enter path again.

          It used to work by pressing F6 and I’d get the python shell with the script output without having to enter the path but no longer. If I press F6 all I get is another notepad++ with cmd window and can open file in it and run with F5. Then I get the python shell with the script output.

          If I press F5 to run script in the original notepad++ window I see the script output in CMD but no python shell with output.

          I also have NppExec plugin and if show Console, nothing happens in it when I press F5.

          This started working this way after I installed Jupyter notebook and uninstalled it. So I suspect something changed. As a result I re-installed notebook++ and with same results. I suspect maybe some dependency in Python was changed when I uninstalled Jupyter which is not easy.

          Not sure if I should uninstall python 3.8.5 and reinstall it.

          1 Reply Last reply Reply Quote 1
          • RA Melis
            RA Melis last edited by

            When I press F6, looks like it opens python idle and not notepad++. I can open and run script in it with python Shell output but not the python Shell output from notepad++ directly.

            1 Reply Last reply Reply Quote 0
            • RA Melis
              RA Melis last edited by

              I guess if you enter path with C:\PythonPrograms\Python\Python38-32\python.exe -i “$(FULL_CURRENT_PATH)”

              If you enter path C:\PythonPrograms\Python\Python38-32\LIb\idlelib\idle.py “$(FULL_CURRENT_PATH)” it opens idle window with same notepad++ script and can run in python shell.

              So my main issues are …

              1. Why does notepad++ not save the entered F5 run python path when your close notepad++, then open it and press F5? Must enter path each time.

              2. Is there a way to run output in python shell directly form notepad++ script without opening idle?
                I still think there is a way to pull up python shell and use it as an output window to run script in notepad++ but it no longer works for me.

              When you use C:\PythonPrograms\Python\Python38-32\LIb\idlelib\idle.py “$(FULL_CURRENT_PATH)” and save runPython shortcut, shut down and reopen, and press runPython shortcut key(s), it remembers and pulls up script in idle where you can press F5 to run script in python shell. Then you can open other files in idle and run them.

              1 Reply Last reply Reply Quote 1
              • Ekopalypse
                Ekopalypse last edited by

                @RA-Melis

                If I understand you correctly, I cannot replicate what you reported.

                67b2428f-33d2-4af8-a142-6e5d6b9356b9-image.png

                If I save a run command it gets saved and is accessible after Npp restart, see RunPython38 entry.

                If you run it with NppExec you get everything included into Npp

                0f996f09-48d6-44f6-a801-c8af68fa6bc9-image.png

                79fde91b-36d7-4386-a567-8e470d4c6ee9-image.png

                Tested with

                5726aecf-9e5d-4606-975c-2092db5ea149-image.png

                1 Reply Last reply Reply Quote 1
                • RA Melis
                  RA Melis last edited by

                  Yes, I just did not know how to use notepad++. I did not know you save path when set up shortcut key, and that for NppExec you reenter path to save it with their assigned F6 shortcut. I guess when I first set up shortcut key I used F6 without a conflict with nppExec and later added NppExec so it did not work with F6.

                  Thanks much for your explanation. So with the NppExec Console working I guess I don’t need Python Shell but I am sure somehow I was using it with out pulling up a second idle script window.

                  I think maybe it was working as follows:
                  I think with the C:\PythonPrograms\Python\Python38-32\LIb\idlelib\idle.py $(FULL_CURRENT_PATH)" it opens a second idle window which can be used to input your script (or copy script shown in notepad++) and then uses python shell as output but the following explanation on google search was confusing since it refers to the second notepad window to enter script but I believe instead it is an idle window that opens to enter your code and hit F5 in that idle window again to see output in Python Shell.

                  See here: https://silentcrash.com/2016/12/run-python-script-notepad/

                  A new notepad window will open. (you can minimize the black command line window)
                  hit F5 and the python shell will now open
                  In the notepad window, write your code Save as ‘example.py’
                  hit F5
                  python in a shell
                  Now, every time you test your modified code, you will be prompted to save the file. When hit F5 the code will run on the python command line shell, it is a very convenient way to code and simultaneously see your code run.

                  I appreciate your help.

                  Ekopalypse 1 Reply Last reply Reply Quote 0
                  • Ekopalypse
                    Ekopalypse @RA Melis last edited by

                    @RA-Melis

                    If it’s just to run a Python script, not even the -i switch is needed. Just ...python.exe "$(FULL_CURRENT_PATH)".
                    This has the advantage that you don’t have to exit the shell.
                    The script is executed and the result is displayed in NppExec’s console window.

                    1 Reply Last reply Reply Quote 1
                    • First post
                      Last post
                    Copyright © 2014 NodeBB Forums | Contributors