Writing and Testing Python/Jython Scripts with Notepad++
Hi all,
I have something interesting for Notepad++ lovers.
You can write scripts and run them with Python Script plugin. I find this very useful for testing custom functions, string functions, etc.
You can install it from Plugin Manager in Notepad++:
I have something interesting for Notepad++ lovers.
You can write scripts and run them with Python Script plugin. I find this very useful for testing custom functions, string functions, etc.
You can install it from Plugin Manager in Notepad++:
Once it's installed and Notepad++ is restarted we will see the new plugin in the Plugins menu:
Creating a new Python script
You can create a new python script from menu Python Script > New Script.
Then write your code and run it from menu Python Script > Run Previous ScriptUsing the Python Console
Besides writing a script with indentation, syntax check, colors, etc. you can also run the python console:
Running Jython Scripts
As you see above we were using Phyton... do you want to use Jython as FDMEE does?
You can create a Run Command in NotePad++ as follows:
java -jar E:\Oracle\Middleware\odi\oracledi.sdk\lib\jython.jar -i "$(FULL_CURRENT_PATH)"
Save it and configure accelerator if you wish:
You can then write scripts in Notepad++, set language to Python (Language > P > Python) save them as .py scripts, and run the command saved above.
That will execute your script and show the result in the JVM:
Note that you have to indent yourself when needed. Would it be better that when I press Enter code is automatically indented if needed? for example when using if statements :-)
Absolutely. You can install Python Indent plugin to get this working:
After enabling it you will get code indented.Running FDMEE Jython Scripts
If you take a look to post Using PyDev for Jython Scripts you will remember about initialization code needed in order to get the context information from a FDMEE Load ID.
If you want to run Jython scripts in Notepad++ with fdmContext and fdmAPI objects you will have to include the initialization code in the script.
After some testing I noticed that same code working in Eclipse was not working in Notepad++. It does not find a suitable driver for Oracle connection :-\
After some googling and troubleshooting I got it working by switching to using the Oracle Call Interface (OCI) method described in this article.
I still prefer PyDev/Eclipse but here you have more options :-)
Enjoy!
0 Response to "Writing and Testing Python/Jython Scripts with Notepad++"
Post a Comment