![]() In the new window that opens up, select the 'Plugin Commands' tab at the top, scroll down until you see the 'Item name' entry from step 2 and click 'Modify'. (Notice the new entry at the bottom? You can click that to execute the script as well) ( Image) ![]() Navigate to: 'Macro' → 'Modify shortcut/Delete Macro' entry. Then, click the new entry which which appears in the 'Menu items', check-mark the 'Place to the macros submenu' and click 'OK'. Then enter the name under which you want the menu entry (or shortcut name) to be in the 'Item name' entry box and click the 'Add/Modify' button. At the bottom right where 'Associated Script' is mentioned, select 'Python' (or the name under which the earlier execute script was saved as) within the drop down list. Navigate to: 'Plugins' → 'NppExec' → 'Advanced Options'. Else, skip to the next section for a more sane alternative.Īdding a shortcut to run Python code in Notepad++ For subsequent executions, you can use the CTRL + F6 shortcut. Tip: When executing a Python script for the first time, hit F6 → select script name (if not previously selected) → 'OK'. ( Image)Ĭlick 'OK' and voila, a console pops up below with the code output in it. In the small entry box that pops up, type in the name of the shortcut and click 'Save'. In the text entry window that open up, enter: python $(FULL_CURRENT_PATH) and click 'Save'. ( Image)Īfter restarting, navigate to: 'Plugins' → 'NppExec' → 'Execute'. You might have to restart N++ for the changes to take effect. In the 'Plugins Manager' window, navigate to "NppExec', check-mark it and click the 'Install' button. Open up Notepad++ and navigate to: 'Plugins' → 'Plugin Manager' ( Image) Here's how you can go about executing Python scripts within N++ and attaching a shortcut key to run the script on demand. But as a lightweight learning tool for beginners or as a text editor, it will do just fine. As some may have already mentioned, Notepad++ is not a Python IDE.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |