By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,199 Members | 1,125 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,199 IT Pros & Developers. It's quick & easy.

how to configure notepad++ to run python script

P: 4
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\python.exe "$(C:\Python26\EXERCISES\logistic.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\EXERCISES>logistic.py
0 0.84
1 0.5376
2 0.99434496

Alternatively in notepadd++ when I put the C:\Python26\python.exe "$(C:\Python26\EXERCISES\logistic.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\python.exe
Process started >>>
C:\Python26\python.exe: can't find '__main__.py' in ''
<<< Process finished.

Could you please help me out to fix this issue.
Feb 12 '11 #1
Share this Question
Share on Google+
2 Replies


P: 4
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\python.exe "$(C:\Python26\EXERCISES\logistic.py)"

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

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

Would anyone have any idea what could be wrong?

Thanks
Feb 13 '11 #2

bvdet
Expert Mod 2.5K+
P: 2,851
I haven't been able to do it either. It should work, I just haven't figured it out yet.
Feb 13 '11 #3

Post your reply

Sign in to post your reply or Sign up for a free account.