You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
(8) |
Dec
(51) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(105) |
Feb
(93) |
Mar
(194) |
Apr
(145) |
May
(100) |
Jun
(111) |
Jul
(117) |
Aug
(126) |
Sep
(233) |
Oct
(138) |
Nov
(164) |
Dec
(109) |
2002 |
Jan
(216) |
Feb
(175) |
Mar
(216) |
Apr
(194) |
May
(157) |
Jun
(140) |
Jul
(158) |
Aug
(73) |
Sep
(105) |
Oct
(164) |
Nov
(104) |
Dec
(95) |
2003 |
Jan
(72) |
Feb
(69) |
Mar
(81) |
Apr
(151) |
May
(101) |
Jun
(139) |
Jul
(99) |
Aug
(118) |
Sep
(115) |
Oct
(151) |
Nov
(161) |
Dec
(102) |
2004 |
Jan
(120) |
Feb
(175) |
Mar
(106) |
Apr
(111) |
May
(54) |
Jun
(78) |
Jul
(76) |
Aug
(105) |
Sep
(94) |
Oct
(143) |
Nov
(75) |
Dec
(85) |
2005 |
Jan
(99) |
Feb
(77) |
Mar
(164) |
Apr
(97) |
May
(79) |
Jun
(57) |
Jul
(65) |
Aug
(102) |
Sep
(95) |
Oct
(129) |
Nov
(123) |
Dec
(52) |
2006 |
Jan
(48) |
Feb
(99) |
Mar
(90) |
Apr
(51) |
May
(81) |
Jun
(136) |
Jul
(56) |
Aug
(109) |
Sep
(50) |
Oct
(44) |
Nov
(74) |
Dec
(75) |
2007 |
Jan
(92) |
Feb
(137) |
Mar
(93) |
Apr
(79) |
May
(52) |
Jun
(74) |
Jul
(143) |
Aug
(175) |
Sep
(154) |
Oct
(137) |
Nov
(88) |
Dec
(90) |
2008 |
Jan
(58) |
Feb
(113) |
Mar
(167) |
Apr
(88) |
May
(105) |
Jun
(37) |
Jul
(87) |
Aug
(72) |
Sep
(56) |
Oct
(41) |
Nov
(102) |
Dec
(70) |
2009 |
Jan
(115) |
Feb
(113) |
Mar
(126) |
Apr
(58) |
May
(125) |
Jun
(45) |
Jul
(90) |
Aug
(125) |
Sep
(84) |
Oct
(61) |
Nov
(111) |
Dec
(61) |
2010 |
Jan
(85) |
Feb
(86) |
Mar
(130) |
Apr
(58) |
May
(57) |
Jun
(32) |
Jul
(25) |
Aug
(50) |
Sep
(41) |
Oct
(65) |
Nov
(63) |
Dec
(24) |
2011 |
Jan
(43) |
Feb
(31) |
Mar
(28) |
Apr
(68) |
May
(53) |
Jun
(42) |
Jul
(58) |
Aug
(26) |
Sep
(51) |
Oct
(76) |
Nov
(60) |
Dec
(9) |
2012 |
Jan
(16) |
Feb
(32) |
Mar
(32) |
Apr
(39) |
May
(16) |
Jun
(19) |
Jul
(3) |
Aug
(11) |
Sep
(35) |
Oct
(47) |
Nov
(28) |
Dec
(18) |
2013 |
Jan
(18) |
Feb
(36) |
Mar
(10) |
Apr
(7) |
May
(7) |
Jun
(27) |
Jul
(17) |
Aug
(35) |
Sep
(19) |
Oct
(31) |
Nov
(8) |
Dec
(22) |
2014 |
Jan
(5) |
Feb
(11) |
Mar
(18) |
Apr
(23) |
May
(26) |
Jun
(14) |
Jul
(18) |
Aug
(26) |
Sep
(20) |
Oct
(48) |
Nov
(13) |
Dec
(9) |
2015 |
Jan
(9) |
Feb
(15) |
Mar
(25) |
Apr
(10) |
May
(26) |
Jun
(6) |
Jul
(13) |
Aug
(5) |
Sep
(14) |
Oct
(36) |
Nov
(24) |
Dec
(18) |
2016 |
Jan
(24) |
Feb
(11) |
Mar
(1) |
Apr
(6) |
May
(7) |
Jun
(3) |
Jul
(9) |
Aug
(15) |
Sep
(22) |
Oct
(5) |
Nov
(5) |
Dec
(2) |
2017 |
Jan
(20) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(5) |
Jun
(7) |
Jul
(14) |
Aug
(9) |
Sep
(18) |
Oct
(2) |
Nov
(3) |
Dec
(3) |
2018 |
Jan
(7) |
Feb
(6) |
Mar
(1) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
(18) |
Sep
(8) |
Oct
(9) |
Nov
(4) |
Dec
(6) |
2019 |
Jan
(5) |
Feb
|
Mar
(2) |
Apr
(4) |
May
(6) |
Jun
(8) |
Jul
(11) |
Aug
(10) |
Sep
(6) |
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
(8) |
Feb
(3) |
Mar
(1) |
Apr
(4) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
(5) |
Nov
(2) |
Dec
(1) |
2021 |
Jan
|
Feb
|
Mar
(5) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(7) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
(5) |
Jul
(15) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
(1) |
Mar
|
Apr
(2) |
May
|
Jun
(5) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jaroslav G. <j_g...@ya...> - 2001-02-16 10:45:57
|
Hello all, I have the following problem with classpaths under Tomcat: Short intro: all JAR files located in $TOMCAT_HOME/lib are added to the Java CLASSPATH and are visible to Jython. NOTE: Their classes are loaded by the system classloader. All JAR files located in an application specific lib directory + application classes directory are visible to a given application. Application specific classes located in: $TOMCAT_HOME/webapps/myapp/WEB-INF/classes Application spec. libraries in: $TOMCAT_HOME/webapps/myapp/WEB-INF/lib NOTE: application specific classes are loader using org.apache.tomcat.loader.AdaptiveClassLoader12 (!) There is only oneway visibility: application classes can refer to classes loaded by the system classloader but NOT vice versa. I have my runtime library mylib.jar located in the application lib directory togehter with the jython.jar $TOMCAT_HOME/webapps/myapp/WEB-INF/lib/mylib.jar $TOMCAT_HOME/webapps/myapp/WEB-INF/lib/jython.jar THE PROBLEM: jython does not see the classes from mylib.jar, it only creates cache for the packages found in the standard Java classpath. (meaning $TOMCAT_HOME/lib + JRE/lib + ...) How to turn jython to inlcude mylib.jar into package cache and make mylib.jar classes accessible? NOTE: I can not move mylib.jar to $TOMCAT_HOME/lib becaus mylib.jar requires access to application specific classses. Thans for any hint Gergic ===== Jaroslav Gergic (Gergi) mailto:j_g...@ya... http://nenya.ms.mff.cuni.cz/~gergic/ __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ |
From: <Sha...@ea...> - 2001-02-13 09:22:40
|
I have installed Jython on Windows NT 4.0. I have used the standard Java stuff, so I use jview. The ActiveState Python 2.0 is already installed on the machine. When I try to import os nothing is actually imported and I can't use any functions. sys.builtin_module_names does not contain any name referring to the operating system so that it seems as if os.py does not know which of the platform-specific modules it should import. When I import ntpath directly everything is fine. I have experimented with the registry file but without success. Am I stupid or what am I doing wrong? Richard Sharp |
From: D-Man <ds...@ri...> - 2001-02-12 22:37:11
|
On Mon, Feb 12, 2001 at 11:31:31AM -0800, Sarwar Raza wrote: | Hello... | I'm hoping someone has run into this. | We have a bunch of third party jars that are required | for our application to function. We set our effective | classpath to a directory, and put all our jars in that You need to include the jar file itself, not just the directory they are in in the CLASSPATH. (This is a jvm requirement, not jython specific). HTH, -D |
From: Sarwar R. <raz...@ya...> - 2001-02-12 19:30:56
|
Hello... I'm hoping someone has run into this. We have a bunch of third party jars that are required for our application to function. We set our effective classpath to a directory, and put all our jars in that directory. Here's what's happening: our jpython scripts import classes from these particular packages. for ex. foo.jar. In our script, we import * from com.bar.foo but the python interpreter cannot "find" the classes in question, though they are in the classpath. The only way we can make this work is to put these troublesome jars in /usr/java/JRE/lib/ext (or Program Files\Javasoft\JRE\1.3\lib\ext), in which case it resolves as needed. We really do not want to have to put stuff in JRE/lib/ext if we don't have to. We'd like to be able to run by just pointing Classpath to a directory with all the jars included. I imagine this will probably have something to do with changing the classpath that the jpython interp. refers to before starting up, 'cos these will likely need to be processed by the packagemanger on startup. Can anyone help? Thanks Sarwar ===== ************************* Sarwar S Raza NMS Software Engineer CommWorks Corporation http://www.wpi.edu/~sraza ************************* __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ |
From: Ype K. <yk...@xs...> - 2001-02-12 19:09:06
|
Jaroslav, > >Whole application framework is written in Java, only templates >are written in python (Jython) and use Java classes. >A particular template can very differ from the one >I sent as an example. I know '%' python operator, >but it definitely does not solve the preformance problem. >I think the performance problem is related to embedding >not to string manipulation. > >Consider a 'template' to be something like JSP (Java Server Page) - >it contains mainly markup code plus some jython scripting. >And this template should be dynamically interpreted - >in order to be able dynamically modify templates >during the application runtime, (without re-compilation penalty which is significant for JSPs) Do you mean things like this: http://www.zope.org/index_html/view_source ? Regards, Ype |
From: Daniel W. <da...@rt...> - 2001-02-12 17:11:50
|
I'm would like to integrate Jython with some existing Java code, which contains calls to java static methods. How do I call java static methods from within Jython? -Dan |
From: Jaroslav G. <j_g...@ya...> - 2001-02-12 10:24:40
|
--- Finn Bock <bc...@wo...> wrote: > I would use something like this: ... > public void setTemplate(String tmpl) { > template = tmpl; > templateCode = __builtin__.compile(template, "<template>", > "exec"); Thank you, that's exactly what I was looking for! I saw something similar when I was browsing PythonInterpreter source code, but I was not sure if this can be used completely out of context and without care about interpreter state. I changed my source according to your suggestion and the time needed to execute my benchmark 1000-times decreased from nearly 17 sec to 720 milliseconds. Thanks. Jarda Gergic ===== Jaroslav Gergic (Gergi) mailto:j_g...@ya... http://nenya.ms.mff.cuni.cz/~gergic/ __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ |
From: <bc...@wo...> - 2001-02-12 09:55:09
|
On Sun, 11 Feb 2001 22:20:09 -0800 (PST), you wrote: >Ugh! I've been working all day translating some low level JPython >classes to Java. I want to see how much it improves performance. > >But I'm getting the following error when trying to use the Java classes >in JPython. Here's a brief example in hope that someone will point out >my error. > >$ cat Queue.java A badly chosen name. In Jython there is a Queue.py module and an import Queue might not find the java class. [snip] >$ TestMsgQueue.py >qSize=false >startQ=Queue@4fec48 >type(startQ)=<jclass org.python.core.PyInstance at 6411754> >Traceback (innermost last): > File "TestMsgQueue.py", line 15, in ? > File "TestMsgQueue.py", line 13, in __init__ >TypeError: putMsg(): 1st arg can't be coerced to Queue A JPython bug. Fixed in Jython-2.0. regards, finn |
From: <bc...@wo...> - 2001-02-12 09:54:52
|
[Jaroslav Gergic] >Hello Jython users/developers, > >I need to use embedded Jython for markup language template >processing/generating because of Python's ability to seamlessly >process string based data (in opposite to Java). > >I wrote a simple template processing (test) application based on the >embedding example distributed with Jython. (see source code bellow) > >It works but it is significantly slow, probably because an template is >parsed every time the renderFace() method is called. True, but techically the slowness can be attributed more the creation and loading of the compiled bytecode than the parsing and compilation of such a small template. >I am looking for >more efficient solution, but Jython's documentation is very spare >about this. > >The solution should work this way: >The template is parsed the first time after initialization/change. >The parsed Jython code is cached and re-used every time renderFace() >method is called. The code cache is cleared upon setTemplate() >method call. Consider please, the Foo and Writer instances >can change with every renderFace() invocation. > >Any suggestions? I would use something like this: import java.io.*; import org.python.core.*; import org.python.util.PythonInterpreter; public class Renderer { String template = null; PyCode templateCode; PythonInterpreter pyi = null; public Renderer(String template) { pyi = new PythonInterpreter(); setTemplate(template); } public String getTemplate() { return template; } public void setTemplate(String tmpl) { template = tmpl; templateCode = __builtin__.compile(template, "<template>", "exec"); } public void renderFace(Object obj, Writer out) { try { pyi.set("foo", obj); pyi.set("out", out); pyi.exec(templateCode); out.flush(); } catch(Exception e) { e.printStackTrace(); } } } The "<template>" string should be replaced with a filename if such is available. It will be used in error messages and stacktraces. The speed improvement is noticable when used with testcode like this: tmpl = open("template.py").read() import java, sys, Renderer r = Renderer(tmpl) for i in range(10): r.renderFace(java.lang.Thread.currentThread(), java.io.OutputStreamWriter(sys.stdout)) regards, fin |
From: Jaroslav G. <j_g...@ya...> - 2001-02-12 09:53:02
|
> >***template.py*** > >out.write(""" > ><html> > ><head> > ><title>Test</title> > ></head> > ><body> > ><h1>Test</h1> > >""") > >out.write("<p>name is {" + foo.name + " }\n") > >out.write(""" > ></body> > ></html> > >""") > >***end sources*** > > Don't embed. > Try using the % operator for strings: > > "<p>name is {%s }\n")" % foo.name Whole application framework is written in Java, only templates are written in python (Jython) and use Java classes. A particular template can very differ from the one I sent as an example. I know '%' python operator, but it definitely does not solve the preformance problem. I think the performance problem is related to embedding not to string manipulation. Consider a 'template' to be something like JSP (Java Server Page) - it contains mainly markup code plus some jython scripting. And this template should be dynamically interpreted - in order to be able dynamically modify templates during the application runtime, (without re-compilation penalty which is significant for JSPs) Regards Jaroslav Gergic ===== Jaroslav Gergic (Gergi) mailto:j_g...@ya... http://nenya.ms.mff.cuni.cz/~gergic/ __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ |
From: John M. <joh...@ya...> - 2001-02-12 06:19:36
|
Ugh! I've been working all day translating some low level JPython classes to Java. I want to see how much it improves performance. But I'm getting the following error when trying to use the Java classes in JPython. Here's a brief example in hope that someone will point out my error. $ cat Queue.java public class Queue { int i; public Queue(int n) { super(); this.i = n; } public void foo(int i, char c) { System.out.println("i=" + i + " c=" + c); } } $ cat MsgQueue.java import Queue; public class MsgQueue { public MsgQueue(boolean qSize) { super(); System.out.println("qSize=" + qSize); } public void putMsg(Queue q) { synchronized (this) { System.out.println("in synchronized putMsg"); } } } $ CLASSPATH=$CLASSPATH:$(pwd) $ javac Queue.java $ javac MsgQueue.java $ cat TestMsgQueue.py #! /usr/bin/env jpython import MsgQueue, Queue class Test(MsgQueue): def __init__(self): MsgQueue.__init__(self, 0) startQ = Queue(10) print 'startQ=%s' % `startQ` print 'type(startQ)=%s' % `type(startQ)` self.putMsg(startQ) t = Test() $ TestMsgQueue.py qSize=false startQ=Queue@4fec48 type(startQ)=<jclass org.python.core.PyInstance at 6411754> Traceback (innermost last): File "TestMsgQueue.py", line 15, in ? File "TestMsgQueue.py", line 13, in __init__ TypeError: putMsg(): 1st arg can't be coerced to Queue $ __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ |
From: Ype K. <yk...@xs...> - 2001-02-11 11:23:25
|
Jaroslav, >... >It works but it is significantly slow, probably because an template is >parsed every time the renderFace() method is called. I am looking for >more efficient solution, but Jython's documentation is very spare >about this. > ... >***template.py*** >out.write(""" ><html> ><head> ><title>Test</title> ></head> ><body> ><h1>Test</h1> >""") >out.write("<p>name is {" + foo.name + " }\n") >out.write(""" ></body> ></html> >""") >***end sources*** Don't embed. Try using the % operator for strings: "<p>name is {%s }\n")" % foo.name Evt. built the left hand operator dynamically. In case you need multiple substitutions use the % operator as: "Some text for %s, another text for %s, enfin." % ("flying the circus" , "monty") You can also built the right hand side dynamically. Alternative: In case you only need to concatenate strings, and some of these vary, put them all in a list, manipulate the list as necessary and then use join: yourListOfStrings[indexOfVaryingString] = newVaryingString theWholeText = ''.join(yourListOfStrings) You might preconcatenate fixed strings as much as possible within this list. Speed improvement should be dramatic either way. Have fun, Ype |
From: Jaroslav G. <j_g...@ya...> - 2001-02-11 10:39:00
|
Hello Jython users/developers, I need to use embedded Jython for markup language template processing/generating because of Python's ability to seamlessly process string based data (in opposite to Java). I wrote a simple template processing (test) application based on the embedding example distributed with Jython. (see source code bellow) It works but it is significantly slow, probably because an template is parsed every time the renderFace() method is called. I am looking for more efficient solution, but Jython's documentation is very spare about this. The solution should work this way: The template is parsed the first time after initialization/change. The parsed Jython code is cached and re-used every time renderFace() method is called. The code cache is cleared upon setTemplate() method call. Consider please, the Foo and Writer instances can change with every renderFace() invocation. Any suggestions? Thanks Jaroslav Gergic ***Renderer.java*** import org.python.core.PyException; import org.python.core.PyInteger; import org.python.core.PyObject; import org.python.util.PythonInterpreter; public class Renderer { String template = null; PythonInterpreter pyi = null; public Renderer(String template) { pyi = new PythonInterpreter(); setTemplate(template); } public String getTemplate() { return template; } public void setTemplate(String tmpl) { template = tmpl; } public void renderFace(Foo obj, Writer out) { try { pyi.set("foo", obj); pyi.set("out", out); pyi.exec(template); } catch(Exception e) { e.printStackTrace(); } } } ***template.py*** out.write(""" <html> <head> <title>Test</title> </head> <body> <h1>Test</h1> """) out.write("<p>name is {" + foo.name + " }\n") out.write(""" </body> </html> """) ***end sources*** ===== Jaroslav Gergic (Gergi) mailto:j_g...@ya... http://nenya.ms.mff.cuni.cz/~gergic/ __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ |
From: Kieran B. <ki...@br...> - 2001-02-08 23:48:21
|
I'd like to create a Java class in jython which would have a static method: public static void initOpenTool(byte major, byte minor) { How do I code this in jython so that I can use my new jython class as a Java class from jythonc? Or has anyone used jython to create an OpenTool for JBuilder? |
From: Daniel W. <da...@rt...> - 2001-02-08 22:33:59
|
>>>>> "Daniel" == Daniel Klein <Da...@jB...> writes: Daniel> if isinstance(SomeObj, SomeClass): Thanks |
From: Daniel K. <Da...@jB...> - 2001-02-08 22:21:21
|
if isinstance(SomeObj, SomeClass): > -----Original Message----- > From: jyt...@li... > [mailto:jyt...@li...]On Behalf Of Daniel > Wickstrom > Sent: Thursday, February 08, 2001 2:07 PM > To: jyt...@li... > Subject: [Jython-users] instanceof? > > > How does one go about finding out if an object is an instance of a > particular class in jython? > > In java you can do: > > if (SomeObj instanceof SomeClass) { > > .... > > > What is the equivalent in jython? > > -Dan > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users > |
From: Daniel W. <da...@rt...> - 2001-02-08 22:06:51
|
How does one go about finding out if an object is an instance of a particular class in jython? In java you can do: if (SomeObj instanceof SomeClass) { .... What is the equivalent in jython? -Dan |
From: D-Man <ds...@ri...> - 2001-02-07 23:49:31
|
On Wed, Feb 07, 2001 at 04:03:36PM -0700, Mats Wichmann wrote: | At 02:01 PM 02/07/2001 -0500, D-Man wrote: | | Thanks. I believe it will help a bit... but I'm still in need You're welcome. | of producing a diagram and I guess the rule is that if you | REALLY understand it yourself that is not so hard. Sigh. | | >In the simplest view, Jython is just a Java library written in Java<br> | >that runs in a JVM. | | Yes, this is what my first-cut Jython picture shows... a class file | (Jython) that runs in the JVM and calls on "standard" Java classes. | What I hadn't worked out how to pictorially include was what happens | when it's run as an interpreter...or what it would look like when | Python modules are imported and called. | How do you have these Python modules? If you compiled them with jythonc --all --jar then they are java bytecodes in a jar file right next to the jython implementation's bytecodes. You would just need to include that jar in the classpath. This is good for distributing your code -- your users don't have to know anything except to have the jar in the classpath. If your Python modules are simply in *.py files, then you must include the directory they are in in the PYTHONPATH system property. I haven't dealt with this yet. If the python code is in the current directory you won't have any trouble. ex: $ jython ./myscript.py If you are embedding the interpreter in a java app, then it is up to you to find the python code (that your users have written) and feed it to the interpreter. -D |
From: Mats W. <ma...@la...> - 2001-02-07 23:04:06
|
At 02:01 PM 02/07/2001 -0500, D-Man wrote: Thanks. I believe it will help a bit... but I'm still in need of producing a diagram and I guess the rule is that if you REALLY understand it yourself that is not so hard. Sigh. >In the simplest view, Jython is just a Java library written in Java<br> >that runs in a JVM. Yes, this is what my first-cut Jython picture shows... a class file (Jython) that runs in the JVM and calls on "standard" Java classes. What I hadn't worked out how to pictorially include was what happens when it's run as an interpreter...or what it would look like when Python modules are imported and called. Mats |
From: Smith, J. A. <js...@co...> - 2001-02-07 22:29:59
|
I apologize for the cross posting (I am still trying to figure out the JPython/Jython mailing lists) and also if this has been asked before or if documentation is available elsewhere. I am trying to run a largish Python program from within a Java application using jython 2.0. The Python program runs without error using the jython.bat command. 1. How can I set up an embedded jython interpreter so it can find the libraries? The Python program uses a few basic library modules (such as string.) 2. Is there a way to package selected (or all) library modules so that they can live in the same jar as the application? I tried importing the class files (in Visual Age) and of course they could not be found. Thanks for your help, Jonathan |
From: D-Man <ds...@ri...> - 2001-02-07 19:00:42
|
I don't have a diagram, but maybe an explanation will help: Jython is a collection of Java classes that work together. This collection of classes (found in jython.jar) can be used in several ways : as an interactive console, an interpreter for python code, and a library that Java classes can use . Since jython is written in Java, it requires a JVM to run. I think the 3 most common ways of using jython are as a python interpreter that can be run on any system with a working JVM, a bridge that allows an application to be written as a combination of Python and Java code, or as an embedded interpreter that will allow your Java application to be extended/customized by users via python code. If you simply use it as a python interpreter, you will not see much difference between CPython and Jython. The main difference is that CPython has several C libraries/extension modules you can access from the Python code and Jython can access any Java library. If you use it to combine Python and Java sources in a single application you will find that Jython allows your python code to access any Java objects and work with them as if they were Python objects. With a certain amount of care, your java code will be able to work with Python objects as if they are Java objects. (The care is that Python can do things that Java can't, and vice versa -- think of free standing functions or static data/methods) When you use jythonc, your python code in parsed, and then some Java code is generated. The generated Java code is little more than a class that makes method calls into the Jython interpreter/library to accomplish what you coded. It can also generate methods whose signatures match what a Java class would expect so that Java code can call the methods without realizing that the class was written in Python. In the simplest view, Jython is just a Java library written in Java that runs in a JVM. HTH, -D On Tue, Feb 06, 2001 at 11:06:26AM -0700, Mats Wichmann wrote: | | I'm looking for a nice illustrative diagram of what Jython | "does" - in other words, how this piece works together with | a "normal" Java environment. | | I've a simplified Java sketch that goes like this | (rendered very roughly into text form): | | | Application: | [[ .java sources ]] ==> (( javac compiler )) ==> [[ .class files ]] | || | || | Java Libraries: [[ java classes: .jar files ]] <==> (( JVM )) | || | || | Native Operating System | | | How would I fold Jython, and Jythonc, into the same | simplified terms (without getting wildly inaccurate): | | | Or even better - does anyone know of an existing diagram | that would make my efforts redundant? | | Thanks, | | Mats |
From: Paul M. <mon...@ch...> - 2001-02-07 18:41:22
|
I read an article in Dr. Dobbs Journal about TclBlend. Which confirmed what I had thought would be possible with Python. While Jacl is to Tcl what Jython is to C Python there didn't seem to be an equivalent to TclBlend's functionality. Has anyone looked into a Python extension in the manner of TclBlend that allows one to run standard cpython and any of its c based modules but can use java classes as well? Thanks, Paul |
From: <bc...@wo...> - 2001-02-07 17:16:16
|
[Syver Enstad] >Greetings jython-users list readers, I come in peace! (This is my first >posting you know ;-) Very cool to layer python on top of java. > >I have a minor patch to suggest for jythonc that tripped me up some time, >while simultaneously fooling around with the classpath (new to java). > >jythonc in it's current incarnation doesn't seem to handle long filenames >too well, or actually it's kindof javac's fault. When compiling from a >directory whose path consists of spaces javac trips up when it is fed the >current directory in the classpath. > >The following quick and dirty fix makes it work fine on my machine: >As you can see the only thing it does is enclose all the paths in the >classpath with "" so that javac won't trip up on directory names that looks >like this: Thanks for reporting this problem. A slightly different patch have been checked into CVS. regards, finn |
From: <bc...@wo...> - 2001-02-07 14:05:51
|
[Robert W. Bill] >In using Tomcat-3.2.1, Jython-2.0, sun jdk-1.2.2, win98. My tests have been with tomcat-4.0m5, jdk1.3 & WinNT. >I've >placed jython.jar in %TOMCAT_HOME%\webapps\jython\WEB-INF\lib and >would also like to place the below servlet (and many frozen >modules) in the same lib directory as jyDispatch.jar. I copied the jyDispatch.jar to ...\WEB-INF\lib. The web.xml contained: <web-app> <servlet> <servlet-name>jyDispatch</servlet-name> <servlet-class>jyDispatch</servlet-class> </servlet> <servlet-mapping> <servlet-name>jyDispatch</servlet-name> <url-pattern>*.py</url-pattern> </servlet-mapping> </web-app> >Ahhh, the >dream of an entirely frozen webapp that could be delivered to >clients in a *.war file just like all the java servlet/JSP >webapps out there, but secretly using Jython :) Difficult as long as the dispatcher is written in jython. In the recent PyServlet.java, the dispatcher can initialize the PythonInterpreter with a usefull python.home because it is written in java. So the dream is possible with the newly added PyServlet.java code. The application is not frozen and the use of jython is quite visible if the user looks in the WEB-INF directory, but with a web.xml file likes this: <web-app> <!-- The JSP page compiler and execution servlet --> <servlet> <servlet-name>PyServlet</servlet-name> <servlet-class>org.python.util.PyServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>PyServlet</servlet-name> <url-pattern>*.py</url-pattern> </servlet-mapping> </web-app> inside a .war file like this: test.py WEB-INF/web.xml WEB-INF/lib/jython.jar WEB-INF/lib/Lib/javaos.py the application is deployable without any outside code or configuration (only when using the CVS version of Jython). >Here's the code: >-------------------------------------------------------------- >#filename: jyDispatch.py >import sys >sys.prefix="." >from javax import servlet >from javax.servlet import http >import os > >class jyDispatch(http.HttpServlet): > def service(self,req, res): > 'Jython servlet dispatcher' > mtimes = {} > ctx = self.getServletContext() > > #test junk > out = res.getWriter() > out.println("<br>sys.path=" + str(sys.path)) > out.println("<br>sys.prefix=" + str(sys.prefix)) > out.println("<br>cwd=" + str(sys.getcwd())) I think you meant os.getcwd(). > # Get the path of the *.py file to be dispatched > path = ctx.getRealPath( req.getServletPath() ) > mtime = os.stat(path)[7] This works for my using the CVS and the setup I described at the very top. > #Other stuff... >---------------------------------------------------------------- > >The "sys.prefix='.'" was added as suggested and This hack is no longer needed with the CVS version. regards, finn |
From: wddozier <wdd...@ea...> - 2001-02-07 07:29:06
|
>> What do you use to prototype and debug in jython? Alpha on Mac, xemacs on Win2000; "print" for debugging. |