Community
    • Login

    How to run python code once written?

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 2 Posters 4.0k 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 HodgeD
      David Hodge
      last edited by

      how do a run a python code once I have typed it. I made some ascii art pictures and I am not sure. When I run the code should it be just the code showing or the pictures also. Thank You. I have the python idle software downloaded and installed and notepad ++.

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

        @David-Hodge

        I can’t say what your python code should do as there is no info what has been coded but
        concerning the execution of code from within python there are several ways to achieve this.

        1. use the run menu and run function (typically keyboard shortcut F5)
          within this dialog you would do something like

          cmd /K python $(FULL_CURRENT_PATH)

        the variable FULL_CURRENT_PATH gets substituted by notepad++ with the full path
        of the current opened document. So it is a must that the script has been already saved
        before you run it.

        1. Install the excellent NppExec plugin. It does basically the same as the build in run function
          but offers a lot more in addition. Like you can define that not only the script should run but
          also some other action should take place. If using the NppExec plugin you do not need
          the cmd shell from the previous example as it has its own “shell” so a call

          python $(FULL_CURRENT_PATH)

        is sufficient.

        3)Install python script plugin. As it is not its native functionality you can use it to run
        scripts as well. Its main purpose is to interact with notepad++, meaning you can
        automatically insert text into your document or reformat it automatically etc…

        Cheers
        Claudia

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