1

I'm just getting into programming and took the common advice of using a free text editor with python. I seem to be running into a problem and everything I've tried so far hasn't worked.

I downloaded Anaconda from this url and whenever I put the location of python.exe into the run bar: C:\Users\Home\Anaconda2\python.exe all I get is the python console to pop up. I've tried adding: "$(FULL_CURRENT_PATH)" to the end as one user had suggested, but that just opens up the console and closes it immediately after. Any idea what I'm doing wrong?

2
  • are you trying to run a script you wrote in Notepad++? Are you familiar with the command prompt?
    – nlloyd
    Commented Feb 6, 2016 at 3:18
  • Yes, I meant that notepad++ won't run any python scripts. I think I'm familiar with cmd.
    – Astrum
    Commented Feb 6, 2016 at 3:48

2 Answers 2

3

First, I usually create a space for all my projects. Usually C:\projects so it's easy to find. Then I create a folder for specific work. I'd do C:\projects\learningPython.

Now, create a new file and save it to C:\projects\learningPython\hello-world.py

In the file put this line

print('Hello World!')

Then click save.

Now open a command prompt (enter cmd in the run bar)

now enter this in the command prompt:

python C:\projects\learningPython\hello-world.py

Hopefully this will work for you. Let me know if you do not see 'Hello World' appear on the command prompt.

3
  • That did work, but as soon as I tried to run a simple Pyplot script it just sent me back an empty line. I'm primarily interested in scientific applications, so if it can't plot points this won't work. Also it's rather inconvenient to go to cmd all the time. Edit: it actually did plot the points just fine, but that still leaves the problem that this is a rather roundabout way of getting it to work.
    – Astrum
    Commented Feb 6, 2016 at 4:07
  • @Astrum you might try getting started with IPython the installation instructions are here. It's a great interactive way to get going with python.
    – nlloyd
    Commented Feb 6, 2016 at 5:20
  • 1
    @Astrum It is not a roundabout way, nearly everybody is doing it that way. You are basically typing "python myscript.py", which is simple enough. Get familiar with the command-line if you want to develop. IPython is also command-line, just nicer.
    – JulienD
    Commented Feb 6, 2016 at 14:35
2

After you followed nlloyd instructions and you are assured that your setup works and you can use Python from the commandline, I would use the nppexec Plugin to integrate Python (and other external tools) with notepad++ . (You can get it from Notepad++ PluginCentral or directly via the Plugins -> PluginManager.) There I would create a nppexec script: with the following lines (use Plugins -> NppExec -> Execute... ):

npp_save
C:\Tools\Python\Python.exe $(FULL_CURRENT_PATH)
  • change C:\Tools\Python\Python.exe to whereever you have installed python
  • save this nppexec script
  • use the commands Execute... and Direct execute previous from Plugins -> Nppexec menu to select the nppexec script (if you have several) and repeatedly use the same nppexec script

Not the answer you're looking for? Browse other questions tagged or ask your own question.