Thursday, August 6, 2009

Notepad++ and Python

I know, I know, I'm using Windows. But it's just temporary, I just felt like playing some video games. Anyway, Notepad++ is awesome, I must say. And I wanted to use it for Python developing (I hate that IDLE Python comes with). To set up Notepad++ for Python developing I had to:
  • Create a batch script that would run a python script and then wait for a key (so that the terminal (or, command line) doesn't disappear);
  • Configure a shortcut in Notepad++ to run that script with the current file as parameter.
First things first: the batch script. Pretty basic, I just looked at a couple of Wikipedia articles and another one about using arguments in batch scripts: @ECHO OFF C:\Python26\python.exe "%1" echo. PAUSE @ECHO ON Then, in Notepad++, I went to Run → Run..., type in C:\Python26\python.bat "$(FULL_CURRENT_PATH)", then Save... and assign a shortcut. Press that shortcut now with a python file opened and boom goes the dynamite. Enjoy :)

16 comments:

  1. This is exactly what I am looking for.

    ReplyDelete
  2. Thanks! Btw, I had to remove the quotation marks in the batch file, but I'm a n00b so I'm not sure why. Using Python 3.1, Notepad 5.6.4, XP.

    ReplyDelete
  3. Awesome. Thanks!

    ReplyDelete
  4. Thank you so much been looking for this!

    ReplyDelete
  5. Works like a charm. Much appreciated.

    ReplyDelete
  6. This is great, thanks! exactly what i needed!

    ReplyDelete
  7. Still helping! Thank you!

    ReplyDelete
  8. Thank you very much, simple, effective and efficient. No more IDLE!

    ReplyDelete
  9. Awesome! Thanks :-)

    ReplyDelete
  10. Ditto! thank you!

    ReplyDelete
  11. I setup notepad++ using these settings long ago. At one point I lost my configuration information, and forgot how I'd set things up to pause when running python scripts. I'm glad I rediscovered this page as I'm up and running again. Don't ever let this page disappear. THANKS!

    ReplyDelete
  12. Brilliant, thank you x 100

    ReplyDelete
  13. The changing to a bat file to prevent the closing was what I was missing - thanks for the post!

    ReplyDelete
  14. Thanks for the tip. Very convenient. :)

    ReplyDelete
  15. Awesome tip! Thanks!

    ReplyDelete