From: Yaqiang W. <yaq...@gm...> - 2019-03-15 05:00:24
|
Also a Jython editor (IDE) was developed in MeteoInfo ( https://github.com/meteoinfo/MeteoInfo) project names MeteoInfoLab for scientific computation and plotting. For better using by others, I recently is pealing several projects from it. For example: NumJy ( https://github.com/Yaqiang/numjy) for multi-dimensional array operation and computation, PlotJy (https://github.com/Yaqiang/plotjy) for 2D/3D plotting, and EditorJy (https://github.com/Yaqiang/editorjy) for Jython code editing and running. I noticed that Fiji script editor also use Rsyntaxtextarea, which is a good base to learn the experience from Fiji project. Regards Yaqiang On Fri, Mar 15, 2019 at 4:25 AM Jeff Allen <ja...@fa...> wrote: > Albert: > > By coincidence, Tobias Kohn has written on the list that he has created an > IDE (for high-school students). And of course there is PyDev within Eclipse > which has achieved something similar and I'm glad to say supports Jython. > > Now I look I'm slightly surprised that a PyCode is that opaque. However, I > believe what you are aiming for would be based on the AST you can get from > the compile() function at the Python level, or Java compiler calls if you > wish. This has much symbolic information embedded in it and links back to > source code. I have played with this in pure Python 3 and Jython's looks > very similar. > > A compled function object is quite inspectable (see inspect module), so > maybe that is a way in for you too. The pdb module must understand the code > it is debugging too, and amazingly works in Jython, so you could look how > that gets from byte code to source code. > > There is an open bug about missing line numbers in ASTs, and I've > sometimes found line numbers in error messages to be off their mark, but > I've always been fixing something else at the time (of course). There may > be some annoyances here. > > Jeff > > Jeff Allen > > On 13/03/2019 02:03, Albert Cardona wrote: > > Hi all, > > In Fiji--an open source java software for image processing--we have an > "Script Editor" [1] capable of executing a number of languages, > including jython. > > I've written big chunks of it and I know its codebase reasonably well. > > What I'd like to do is to add IDE features such as the ability to > select a name and jump to its definition, be it within the same file > (perhaps easier, and a good start) or some other file. > > I understand that the org.python.util.PythonInterpreter has methods to > compile, but not execute, a bunch of code, returning a PyCode object. > > Are there introspection methods in the returned PyCode that could be > used for the above purpose? Or how would you approach this feature? > > Thanks for any suggestions. > > Albert Cardona > > [1] https://github.com/scijava/script-editor > > > -- > Group Leader, HHMI Janelia Research Campus, USA. > Reader (Associate Professor), Dept. Physiol. Dev. Neurosci., > University of Cambridge, UK.https://albert.rierol.nethttps://www.janelia.org/lab/cardona-lab/https://www.pdn.cam.ac.uk/directory/albert-cardona > > > _______________________________________________ > Jython-dev mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/jython-dev > > _______________________________________________ > Jython-dev mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-dev > -- ************************************************* Dr. Yaqiang Wang Chinese Academy of Meteorological Sciences (CAMS) 46, Zhong-Guan-Cun South Avenue Beijing, 100081 China yaq...@gm... www.meteothink.org ************************************************** |