how to configure notepad++ to run python script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sean Asemani
    New Member
    • Feb 2011
    • 4

    how to configure notepad++ to run python script

    Hello All

    I am new to python and using python 2.6 for few weeks with no problem.

    I like notepad++ and trying to run pythons script in notepad++.

    In notepadd++, Run menu > Run dialog box I entered following line:

    C:\Python26\pyt hon.exe "$(C:\Python26\ EXERCISES\logis tic.py)"

    After clicking on 'Save' button, in next window I select a shortcut key such as: (CTRL + R) or F8, etc.)

    I restarted notepad++, when I click designated shortcut key to run my python script the python interpreter screen open and close in less then a second.

    After that no matter how many times I use shortcut key it doesn't work at all.

    When I click on python.exe python interpreter screen opens and I can run any python script like:

    C:\Python26\EXE RCISES>logistic .py
    0 0.84
    1 0.5376
    2 0.99434496

    Alternatively in notepadd++ when I put the C:\Python26\pyt hon.exe "$(C:\Python26\ EXERCISES\logis tic.py)" in Plugins > Npp Exec > Execute window, after clicking on 'Save' button and then 'Ok' button to run the script, it gives me the following error:

    C:\Python26\pyt hon.exe
    Process started >>>
    C:\Python26\pyt hon.exe: can't find '__main__.py' in ''
    <<< Process finished.

    Could you please help me out to fix this issue.
  • Sean Asemani
    New Member
    • Feb 2011
    • 4

    #2
    python in notepad++

    Hello All

    I am new to python and notepad++.

    I was reading all the questions in the 'python in notepad++' section\forum of this web site.

    I've configured the 'shortcuts.xml' file (in notepad++ directory) exactly the way it was explained in the forum
    but when i re-open notepad++ and press shortcut keys, nothing happened.

    Also as Crisb mentioned in the forum, I setup the NppExec in notepad++ as he guided:

    C:\Python26\pyt hon.exe "$(C:\Python26\ EXERCISES\logis tic.py)"

    but when I try to run any python script from within notepad++, I get the following error:

    C:\Python26\pyt hon.exe
    Process started >>>
    C:\Python26\pyt hon.exe: can't find '__main__.py' in ''
    <<< Process finished.

    Would anyone have any idea what could be wrong?

    Thanks

    Comment

    • bvdet
      Recognized Expert Specialist
      • Oct 2006
      • 2851

      #3
      I haven't been able to do it either. It should work, I just haven't figured it out yet.

      Comment

      Working...