14 Jan 2010

Compile & Run Python Scripts with PSPad

PSPad is a great editor for programmers. Instead of using a dedicated Python IDE, PSPad can be tweaked to compile and run scripts directly. Here’s how: -


pspad


  • Go to Settings -> Highlighters Settings
  • Select “Python” in the left hand pane (if its not selected already)
  • Select the “Compiler” tab
  • In the “compiler” text box, enter or browse to the location of the Python compiler
  • In the “parameters” text box, you have 2 choice, which are corresponed to later actions:



    • 1. enter “%File%” (with the double quotes) this is the official way to do it.
    • 2. enter “%name%.py” (without the double quotes) I use this one.



  • Put a tick box in the “Capture Program Output Window” option
  • If you just want to run the python code, it's OK now. If you want to see the result in a seperate window, go on:



    • 1. enter "cmd /c python "%File%" && pause" (without the double quotes)
    • 2. enter "cmd /c python "%name%.py" && pause" (without the double quotes)





here are 2 pics about my configration:




No comments :

Post a Comment