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: Ted B. <te...@et...> - 2001-09-13 01:28:49
|
On Wednesday 12 September 2001 17:53, Greg Czajkowski wrote: > Has anyone run into this install problem: > C:\Jython-2.0>C:\jdk1.3.1_01\bin\java.exe -cp . > jython-20.class > Exception in thread "main" > java.lang.NoClassDefFoundError: jython-20/class > > it seems like its looking for files in the class > directory. But looking at the class file with winzip > doesn't show that as a directory. > > Any help would be appreciated. > --Greg Try this instead: C:\Jython-2.0>C:\jdk1.3.1_01\bin\java.exe -cp . jython-20 when running a java .class file, leave the ".class" out of the class name. ted |
From: Greg C. <gre...@ya...> - 2001-09-13 00:53:05
|
Has anyone run into this install problem: C:\Jython-2.0>C:\jdk1.3.1_01\bin\java.exe -cp . jython-20.class Exception in thread "main" java.lang.NoClassDefFoundError: jython-20/class it seems like its looking for files in the class directory. But looking at the class file with winzip doesn't show that as a directory. Any help would be appreciated. --Greg __________________________________________________ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com |
From: Kevin D. <kda...@we...> - 2001-09-12 18:39:58
|
Hi, Generally speaking, Jython and CPython are very compatible. If there are no C extension modules involved, most things just work. Where there are C modules, you'll need to figure out the Java equivalent. There is a page describing the differences here: http://www.jython.org/docs/differences.html If you've got a lot of Zope-specific code (that uses Zope's Persistence and Acquisition), then it's not so straightforward. We have a project underway to get Zope running under Java: http://www.phabric.org. However, we don't quite have it running yet. It's open source, so you're welcome to take a look. We'll answer any questions you may have about what's there now... Kevin ----- Original Message ----- From: "Christoph Romann" <rom...@zh...> To: <jyt...@li...> Sent: Wednesday, September 12, 2001 2:26 PM Subject: [Jython-users] adaption of CPython to Jpython > Hello people > > i've a litle problem and i hope anybody could help me. i've some code > writen in standard CPython. Now we change ou're application to un ejb, so > we want to migrate to java. as i don't want to write the whole stuff new, > i decided to use JPython. > My questions is: is thee a tool which can adapt the normal difference of > this two version, so that i don't have to correct everything by myself? > Or does a better solution exits, which enables me to use the old CPython > code in the new enviroment. > the application server was is zope. > > thanks for you're help!! > > chris > > > Content Security by MailMarshal > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Ype K. <yk...@xs...> - 2001-09-12 18:37:55
|
>Hi, > >why does the following not work: > >a = [1, 2] >for i in a: > a.remove(i) > > >The loop exits after the first iteration leaving a = [2] > >How do I get around this problem? Iterating over a list that is being modified results in undefined behaviour. A better way is: for i in a[:]: # iterate over a copy a.remove(i) # remove from original The problem with this is that it still needs to access each element in the list (at least twice). When you need to remove some of the elements in a list you could also use list comprehensions, but these always create a new list: a = [i for i in a if not someRemoveCondition(i)] To empty a list in a single operation you can also: a[:] = [] # modify in place to become an empty list. (A) or a = [] # change to refer to a new empty list object. (B) or, preferably: del a[:] # modify in place deleting all entries (C) The last variant does not create a new object, which can make a measurable difference for garbage collection in case it avoids creating a lot of them. This technique is also known as reusing existing objects. I have never measured the difference between (A) and the other two, but (C) is definitely faster than (B) in Jython. It is probably faster in CPython, too. > >Any help appreciated, >Kevin My pleasure, Ype |
From: <bc...@wo...> - 2001-09-12 18:33:41
|
[Sebastien Pierre] >Hi all, > >I get a "read-only attribute" error when I try to assign a value to an >inherited protected attribute. There is no support at all for direct access to protected fields. >The FAQ talks about protected static >fields, which is not the case. Is there any turnaround? You could perhaps: - Add a java setter method. - play with the respectJavaAccessibility registry setting. >BTW, I was wondering how to access the ".class" attribute of any Object >in Java from Jython, >>> import java >>> d = java.util.Date() >>> d.__class__ <jclass java.util.Date at 2751722> >>> or just use java.util.Date class directly. >and how to do an "instanceof" instruction in Jython. >>> if isinstance(d, java.util.Date): print "got a date!" ... got a date! regards, finn |
From: Samuele P. <pe...@in...> - 2001-09-12 18:27:03
|
Hi. The idea of the patch is fine for me, on the other hand it needs some work to better integrate with the rest of the import logic. In any case I would like to understand why so often jars are reported as bad, this should be quite rare... I think we should dig into that. regards, Samuele. > From: bc...@wo... (Finn Bock) > To: jyt...@li... > Subject: Re: [Jython-users] Simple java class import > X-BeenThere: jyt...@li... > X-Mailman-Version: 2.0.5 > List-Help: <mailto:jyt...@li...?subject=help> > List-Post: <mailto:jyt...@li...> > List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/jython-users>, <mailto:jyt...@li...?subject=subscribe> > List-Id: <jython-users.lists.sourceforge.net> > List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/jython-users>, <mailto:jyt...@li...?subject=unsubscribe> > List-Archive: <https://lists.sourceforge.net/archives//jython-users/> > X-Original-Date: Wed, 12 Sep 2001 18:16:09 GMT > Date: Wed, 12 Sep 2001 18:16:09 GMT > Mime-Version: 1.0 > > [Humbel Otmar] > > >Hello, > > > >when there is an 'invalid' .jar file in the classpath from where java can > >load classes, but from which the jython package manager cannot determine > >packages (other people have told us about similar problems with the jar > >utility here), I would nonetheless like to be able to import single java > >classes. > > > >The problem manifests as follows (package CH.obj.Libraries.Servlet lives > >inside the offending bisonInfra.jar): > > > > > >[appl|pwe] > jython > >*sys-package-mgr*: processing modified jar, 'E:\java\lib\bisonInfra.jar' > >*sys-package-mgr*: skipping bad jar, 'e:\java\lib\bisonInfra.jar' > >Jython 2.0 on java1.3.0 (JIT: null) > >Type "copyright", "credits" or "license" for more information. > >>>> from CH.obj.Libraries.Servlet import ServletSessionContext > >Traceback (innermost last): > > File "<console>", line 1, in ? > >ImportError: No module named Servlet > >>>> from java.lang import Class > >>>> clazz = Class.forName( "CH.obj.Libraries.Servlet.ServletSessionContext" > >) > >>>> clazz > ><jclass CH.obj.Libraries.Servlet.ServletSessionContext at 7698425> > >>>> > > > > > >For an 'intuitive' Jython user like me, there is no obvious reason why this > >import should fail ? > > I agree. > > >My motto is: Jython can import everything java can load ! > > I agree again. I hope you at least understand why importing java > packages fails. > > >With the following lines added just at the beginning of method importFromAs > > Please add this as a patch to the SF patch manager. That way we will not > forget it. > > >in org/python/core/imp.java (from the 2.0 codebase): > > > > public static void importFromAs(String mod, String[] names, String[] > >asnames, PyFrame frame) { > > if ( names.length==1 && asnames.length==names.length && > >asnames[0].equals(names[0]) ) { > > // this is a candidate for simple java class import > > String packageName = mod; > > String fullClassName = packageName + "." + names[0]; > > try { > > Class.forName( fullClassName ); > > PySystemState.add_package( packageName ); > > } catch( Throwable t ) {} > > } > > // rest of method left untouched > > // ... > > } > > > >the problem above would be solved. These lines do not at all claim to be > >perfect, they are thought just to show that it could be done: > > Of the top of my head, I kinda like it. It a pragmatic solution to a > huge problem which we (I fear) will never resolve perfectly. > > regards, > finn > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: <bc...@wo...> - 2001-09-12 18:25:55
|
[Richard Cook] >if I write (in tst.py) > >from javax.swing import * >b=JLabel("bob", displayedMnemonic=66) > >jython tst.py gives: > >Traceback (innermost last): > File "tst.py", line 2, in ? >AttributeError: read-only attr: displayedMnemonic > >If I have this: > >from javax.swing import * > >class Dummy(JPanel): > pass > >b=JLabel("bob", displayedMnemonic=66) > >Then I get no complaint. Strange. It seems like the sequence of reflected methods is different when the Dummy class exists. I have no explanation for this at the moment. >Am I doing something wrong? No, it is bug in jython. Feel free to add a bug report on sourceforge with your example. The bug is triggered because there is two setDisplayedMnemonic(..) methods. As a result, jython can't decide what the type of the property should be. Since there can only be one property with the name 'displayedMnemonic' it is either a read/write integer property or a read-only character property. Which it is, depends on the sequence the methods is returned from java reflection. >Also, because displayedMnemonic is an int property, > >b=JLabel("bob", displayedMnemonic='b') >fails (can't convert string to int) > >but >b.setDisplayedMnemonic('b') works OK because presumably it calls >setDisplayedMnemonic(char) Right. Here the properties is skipped altogether and the method is called directly. regards, finn |
From: Christoph R. <rom...@zh...> - 2001-09-12 18:25:01
|
Hello people i've a litle problem and i hope anybody could help me. i've some code writen in standard CPython. Now we change ou're application to un ejb, so we want to migrate to java. as i don't want to write the whole stuff new, i decided to use JPython. My questions is: is thee a tool which can adapt the normal difference of this two version, so that i don't have to correct everything by myself? Or does a better solution exits, which enables me to use the old CPython code in the new enviroment. the application server was is zope. thanks for you're help!! chris Content Security by MailMarshal |
From: <bc...@wo...> - 2001-09-12 18:13:43
|
[Humbel Otmar] >Hello, > >when there is an 'invalid' .jar file in the classpath from where java can >load classes, but from which the jython package manager cannot determine >packages (other people have told us about similar problems with the jar >utility here), I would nonetheless like to be able to import single java >classes. > >The problem manifests as follows (package CH.obj.Libraries.Servlet lives >inside the offending bisonInfra.jar): > > >[appl|pwe] > jython >*sys-package-mgr*: processing modified jar, 'E:\java\lib\bisonInfra.jar' >*sys-package-mgr*: skipping bad jar, 'e:\java\lib\bisonInfra.jar' >Jython 2.0 on java1.3.0 (JIT: null) >Type "copyright", "credits" or "license" for more information. >>>> from CH.obj.Libraries.Servlet import ServletSessionContext >Traceback (innermost last): > File "<console>", line 1, in ? >ImportError: No module named Servlet >>>> from java.lang import Class >>>> clazz = Class.forName( "CH.obj.Libraries.Servlet.ServletSessionContext" >) >>>> clazz ><jclass CH.obj.Libraries.Servlet.ServletSessionContext at 7698425> >>>> > > >For an 'intuitive' Jython user like me, there is no obvious reason why this >import should fail ? I agree. >My motto is: Jython can import everything java can load ! I agree again. I hope you at least understand why importing java packages fails. >With the following lines added just at the beginning of method importFromAs Please add this as a patch to the SF patch manager. That way we will not forget it. >in org/python/core/imp.java (from the 2.0 codebase): > > public static void importFromAs(String mod, String[] names, String[] >asnames, PyFrame frame) { > if ( names.length==1 && asnames.length==names.length && >asnames[0].equals(names[0]) ) { > // this is a candidate for simple java class import > String packageName = mod; > String fullClassName = packageName + "." + names[0]; > try { > Class.forName( fullClassName ); > PySystemState.add_package( packageName ); > } catch( Throwable t ) {} > } > // rest of method left untouched > // ... > } > >the problem above would be solved. These lines do not at all claim to be >perfect, they are thought just to show that it could be done: Of the top of my head, I kinda like it. It a pragmatic solution to a huge problem which we (I fear) will never resolve perfectly. regards, finn |
From: <bc...@wo...> - 2001-09-12 17:34:24
|
[dman] >... I have been getting "can't write to cache" errors >lately but I have no idea why (windows/cygwin, dir is writable). I >have "new" jars pretty frequently anyways. Commonly seen when moving a jython installation to a different directory. The cache index (packages.idx) contains absolute path names to the the individual jar indexes (.pkc). After a move the paths insode packages.idx doesn't exists anymore and it can't updated them. Normally the workaround is easy: just delete cachedir regards, finn |
From: <bc...@wo...> - 2001-09-12 17:01:20
|
[Sebastien Pierre] >Hi all, > >I have written two classes, namely XMLElement and XMLTextElement in a >file named XMLElement.py. I load this file using a PythonInterpreter in >my main static method of my main class. > >Another class (XMLDocument) makes use of reflection using the >Class.forName("XMLElement.XMLElement") to get the class I declared in >Python. The problem is that the class is not found. Correct. >So I looked in the FAQ and have not seen any answer, so here are the >possibilties I can think of: > - Python does not define classes that are usable from the running JVM A pure python class (a class without any java classes/interfaces as base class) does not exists in the form of a java class. If your python class have a java class/interface as base class, you can call and use the methods defined in the java base (and possible overriden in the python class). A pure python class can instead be accessed and used with the Jython/Java API. Try something like: // get hold of the class PyObject XMLElementClass = interp.get("XMLElement"); // Create an instance of XMLElement PyObject XMLElement = XMLElementClass.__call__(); // Invoke the foobar method with two args. XMLElement.invoke("foobar", new PyInteger(42), new PyString("Hello world")); regards, finn |
From: Kevin B. <kb...@ca...> - 2001-09-12 15:53:52
|
That's cool! :-) It looks like what is happening is that the 'for i in a:' tracks the index it is working on, so if you remove items, you get every other one: >>> a = range( 10 ) >>> for i in a: ... print i ... a.remove( i ) ... 0 2 4 6 8 >>> You can make a copy of the list, and iterate over that copy: >>> a = range( 10 ) >>> for i in tuple(a): ... print i ... a.remove( i ) ... 0 1 2 3 4 5 6 7 8 9 >>> a [] >>> kb Kevin McNamee wrote: > > Hi, > > why does the following not work: > > a = [1, 2] > for i in a: > a.remove(i) > > The loop exits after the first iteration leaving a = [2] > > How do I get around this problem? > > Any help appreciated, > Kevin > > _________________________________________________ > Name/Title : Kevin McNamee, Software Consultant > Phone : +46 13 32 1165 > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: <ber...@ya...> - 2001-09-12 15:49:26
|
With the java code below, I obtain the list of available methods of the StringTonenizer class (but not of mother classes) while I am unable to obtain them for my own Enum class. Is there somebody able to explain me this difference and where it is documented (sorry if it is but I didn't find it) ? Here is the jython console where I try to introspect my Enum class (made for demonstration purpose). Jython 2.0 on java1.3.0 (JIT: null) >>> dir(enum.__class__) [] >>> dir(tokenizer.__class__) ['countTokens', 'hasMoreTokens', 'nextToken'] >>> a = enum.nextElement() >>> a 'one' >>> a = enum.nextElement() >>> a 'two' >>> a = tokenizer.nextElement() >>> a 'This' >>> a = tokenizer.nextElement() >>> a 'is' >>> And here is the java code. package trybox; import org.python.core.*; import org.python.util.InteractiveConsole; import java.util.Enumeration; import java.util.StringTokenizer; public class TryJython { public TryJython() { } public static void main(String[] args) { TryJython tryJython = new TryJython(); tryJython.doIt(); } void doIt() { Enumeration enum = new Enum(); Enumeration tokenizer = new StringTokenizer("This is a test"); InteractiveConsole console = new InteractiveConsole(); console.set("enum", enum); console.set("tokenizer", tokenizer); console.interact(); } public class Enum implements Enumeration { String [] values = {"one", "two", "tree", "four", "five"}; int index = 0; public boolean hasMoreElements() { return (index < values.length); } public Object nextElement() { return values[index++]; } } } TIA. Bertrand. ___________________________________________________________ Do You Yahoo!? -- Un e-mail gratuit @yahoo.fr ! Yahoo! Courrier : http://fr.mail.yahoo.com |
From: Donatas S. <don...@no...> - 2001-09-12 13:50:34
|
Use java.lang.Runtime class exec methods for starting another process. On Wednesday 12 September 2001 15:29, Arne Wulvik wrote: > Hi! > > Kind of a newbie question, but: > > I'd like to be able to start other processes, like shell scripts, on the os > (nt or unix) from a Jython script. I thought I could use os.fork, or > os.system but they are not available in the java-dependent module used by > os. Do I have to look for some java classes that does the trick? > > Any suggestions? > > Arne -- Donatas Simkunas Senior Programmer No Magic Phone: +370 7 325032 Fax: +370 7 320670 e-mail: don...@no... WWW: http://www.nomagic.com |
From: Antonio R. <An...@ho...> - 2001-09-12 13:34:58
|
I dont think that it can be done from jython, but it certainly can be done from java. Take a look at the Runtime class. You can do lots of these types of things there. Antonio -|Arne Wulvik <wu...@pr...> wrote on Wed Sep 12 09:25:13 EDT 2001: Hi! Kind of a newbie question, but: I'd like to be able to start other processes, like shell scripts, on the os (nt or unix) from a Jython script. I thought I could use os.fork, or os.system but they are not available in the java-dependent module used by os. Do I have to look for some java classes that does the trick? Any suggestions? Arne |
From: Arne W. <wu...@pr...> - 2001-09-12 13:30:10
|
Hi! Kind of a newbie question, but: I'd like to be able to start other processes, like shell scripts, on the = os (nt or unix) from a Jython script. I thought I could use os.fork, or = os.system but they are not available in the java-dependent module used = by os. Do I have to look for some java classes that does the trick? Any suggestions? Arne |
From: Antonio R. <An...@ho...> - 2001-09-12 12:56:52
|
Hi all, I'm not sure if its called byte-compiling in jython, but is there a way to turn all of the standard library that ships with Jython into .class files, stick them into a jar and set the PythonInterpreter instances to load them from there as opposed to from the Lib directory? On a related note, what is the equivalent of PythonInterpreter.execfile() when one wnats to exec a .class file instead of the .py file? To clarify, right now, what I generally do to use jython objects in my java programs is 1) subclass a java classs (so I can call methods from java), 2) instantiate an interpreter in java and call interpreter.execfile ( PySubclass.py ), 3) create the PyObject of the subclass and coerce it into the right type of java object through the __tojava__ method. Then I happily use the object as a full on java object. While this is very very very cool (one of the coolest things I've ever seen in java-- kudos to all of you), I'm wondering whether there might be a more efficient way to do this, and I find that not having to reparse/recompile the .py file every time is probably a good place to start. I looked at some of the code that jythonc generates, but I am at a loss as to how to get java objects out of all of those static inner class methods. Thanks for the help, Antonio |
From: Kevin M. <kev...@er...> - 2001-09-12 12:37:48
|
Hi, why does the following not work: a = [1, 2] for i in a: a.remove(i) The loop exits after the first iteration leaving a = [2] How do I get around this problem? Any help appreciated, Kevin _________________________________________________ Name/Title : Kevin McNamee, Software Consultant Phone : +46 13 32 1165 |
From: Frank C. <fc...@pu...> - 2001-09-12 04:44:16
|
Sounds great. I'll check it out. To get back to the correct source line are you parsing the standard-output for the error message? -Frank -- Frank Cohen, founder, PushToTest, www.pushtotest.com, phone: 408 374 7426 Come to PushToTest for Load, a free open-source tool for performance and scalability testing and data migration. > From: "Romain Guy" <rom...@je...> > Reply-To: "Romain Guy" <rom...@je...> > Date: Tue, 11 Sep 2001 19:35:30 +0200 > To: <jyt...@li...> > Subject: Re: [Jython-users] What are Jython folks using to edit? > > My own text editor, Jext, integrates Python syntax colorizing, Python > class browser, and an integrated release of Jython. Any error generated > while executing a Jython source code (F5) is reported in a log window and a > double-click on it brings you back to the source code line. > > www.jext.org > > Romain "Java Swinguer !" Guy > rom...@je... > www.jext.org > > "Now, don't you worry. The saucers are up there. The graveyard is out there. > But I'll be locked up safely in there." > - Paula Trent, Plan 9 From Outer Space > ----- Original Message ----- > From: "Ype Kingma" <yk...@xs...> > To: <jyt...@li...> > Sent: Tuesday, September 11, 2001 8:18 PM > Subject: Re: [Jython-users] What are Jython folks using to edit? > > >> Frank, >> >>> Thanks for the tips. When you use an editor and Jython reports and error > is >>> there anything you're using now that brings your editor back to the link >>> originating the error? >> >> I considered writing a python script for that (reading the traceback >> and using that to invoke vi on the correct file and line), as i did >> for javac. I never got to do it, though. The problem is that python is >> not a compiler that can be relatively sure where the error occurred. >> >> Jumping into a file might be limited to syntax errors, though. >> But with the syntax support in the editor there are relatively few >> syntax errors left. >> >> Good luck, >> Ype >> >>> -Frank >>> >>> -- >>> Frank Cohen, founder, PushToTest, www.pushtotest.com, phone: 408 374 7426 >>> Come to PushToTest for Load, a free open-source tool for performance and >>> scalability testing and data migration. >>> >>>> From: Ype Kingma <yk...@xs...> >>>> Date: Sun, 9 Sep 2001 23:43:57 +0100 >>>> To: jyt...@li... >>>> Subject: Re: [Jython-users] What are Jython folks using to edit? >>>> >>>> Frank, >>>> >>>>> I'm considering contributing code to NetBeans as an IDE to do Jython > script >>>>> editing. I'm wondering what people are using to edit Jython scripts? >>>> >>>> On unix I use vi, on the mac BBEdit, >>>> and everywhere else any flat text editor. >>>> I grew up in vi and somehow never needed emacs. Vi has good >>>> python support under unix (syntax coloring, indentation). >>>> BBEdit has very nice multifile regex searching capabilities, but >>>> I use python/jython only very occasionaly on the Mac. >>>> Surprisingly the flat text editors on other platforms are a lot easier >>>> to use with python than I expected because of the easy syntax. >>>> They do leave the occasional missing colon or inconsistent dedent, >>>> so better support for python is certainly possible, but not a prime > concern. >>>> >>>> None of the editors I use can identify a possible NameError. Since this >>>> is my most frequent mistake (mistyping a name), this might be really >>>> nice to have. Importing modules just for name editing purposes might >>>> be overkill, though. >>>> >>>> Good luck, >>>> Ype >>>> >>>> _______________________________________________ >>>> Jython-users mailing list >>>> Jyt...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jython-users >> >> >> _______________________________________________ >> Jython-users mailing list >> Jyt...@li... >> https://lists.sourceforge.net/lists/listinfo/jython-users > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Romain G. <rom...@je...> - 2001-09-11 17:31:07
|
My own text editor, Jext, integrates Python syntax colorizing, Python class browser, and an integrated release of Jython. Any error generated while executing a Jython source code (F5) is reported in a log window and a double-click on it brings you back to the source code line. www.jext.org Romain "Java Swinguer !" Guy rom...@je... www.jext.org "Now, don't you worry. The saucers are up there. The graveyard is out there. But I'll be locked up safely in there." - Paula Trent, Plan 9 From Outer Space ----- Original Message ----- From: "Ype Kingma" <yk...@xs...> To: <jyt...@li...> Sent: Tuesday, September 11, 2001 8:18 PM Subject: Re: [Jython-users] What are Jython folks using to edit? > Frank, > > >Thanks for the tips. When you use an editor and Jython reports and error is > >there anything you're using now that brings your editor back to the link > >originating the error? > > I considered writing a python script for that (reading the traceback > and using that to invoke vi on the correct file and line), as i did > for javac. I never got to do it, though. The problem is that python is > not a compiler that can be relatively sure where the error occurred. > > Jumping into a file might be limited to syntax errors, though. > But with the syntax support in the editor there are relatively few > syntax errors left. > > Good luck, > Ype > > >-Frank > > > >-- > >Frank Cohen, founder, PushToTest, www.pushtotest.com, phone: 408 374 7426 > >Come to PushToTest for Load, a free open-source tool for performance and > >scalability testing and data migration. > > > >> From: Ype Kingma <yk...@xs...> > >> Date: Sun, 9 Sep 2001 23:43:57 +0100 > >> To: jyt...@li... > >> Subject: Re: [Jython-users] What are Jython folks using to edit? > >> > >> Frank, > >> > >>> I'm considering contributing code to NetBeans as an IDE to do Jython script > >>> editing. I'm wondering what people are using to edit Jython scripts? > >> > >> On unix I use vi, on the mac BBEdit, > >> and everywhere else any flat text editor. > >> I grew up in vi and somehow never needed emacs. Vi has good > >> python support under unix (syntax coloring, indentation). > >> BBEdit has very nice multifile regex searching capabilities, but > >> I use python/jython only very occasionaly on the Mac. > >> Surprisingly the flat text editors on other platforms are a lot easier > >> to use with python than I expected because of the easy syntax. > >> They do leave the occasional missing colon or inconsistent dedent, > >> so better support for python is certainly possible, but not a prime concern. > >> > >> None of the editors I use can identify a possible NameError. Since this > >> is my most frequent mistake (mistyping a name), this might be really > >> nice to have. Importing modules just for name editing purposes might > >> be overkill, though. > >> > >> Good luck, > >> Ype > >> > >> _______________________________________________ > >> Jython-users mailing list > > > Jyt...@li... > > > https://lists.sourceforge.net/lists/listinfo/jython-users > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: <bc...@wo...> - 2001-09-11 17:29:02
|
[Carlos Quiroz] >[...] >Is there any license reason why I can't make my own jython distribution and >expand it as a jar file? I have already answered Carlos in private, but to make is clear: all the licenses allow derivative works and redistributions. There are certain things that must be fullfilled first. The licenses files must be included, a list of mofications must be available somewhere and the result can not be called JPython. As always, common sense should be applied. regards, finn |
From: Ype K. <yk...@xs...> - 2001-09-11 17:24:12
|
Frank, >Thanks for the tips. When you use an editor and Jython reports and error is >there anything you're using now that brings your editor back to the link >originating the error? I considered writing a python script for that (reading the traceback and using that to invoke vi on the correct file and line), as i did for javac. I never got to do it, though. The problem is that python is not a compiler that can be relatively sure where the error occurred. Jumping into a file might be limited to syntax errors, though. But with the syntax support in the editor there are relatively few syntax errors left. Good luck, Ype >-Frank > >-- >Frank Cohen, founder, PushToTest, www.pushtotest.com, phone: 408 374 7426 >Come to PushToTest for Load, a free open-source tool for performance and >scalability testing and data migration. > >> From: Ype Kingma <yk...@xs...> >> Date: Sun, 9 Sep 2001 23:43:57 +0100 >> To: jyt...@li... >> Subject: Re: [Jython-users] What are Jython folks using to edit? >> >> Frank, >> >>> I'm considering contributing code to NetBeans as an IDE to do Jython script >>> editing. I'm wondering what people are using to edit Jython scripts? >> >> On unix I use vi, on the mac BBEdit, >> and everywhere else any flat text editor. >> I grew up in vi and somehow never needed emacs. Vi has good >> python support under unix (syntax coloring, indentation). >> BBEdit has very nice multifile regex searching capabilities, but >> I use python/jython only very occasionaly on the Mac. >> Surprisingly the flat text editors on other platforms are a lot easier >> to use with python than I expected because of the easy syntax. >> They do leave the occasional missing colon or inconsistent dedent, >> so better support for python is certainly possible, but not a prime concern. >> >> None of the editors I use can identify a possible NameError. Since this >> is my most frequent mistake (mistyping a name), this might be really >> nice to have. Importing modules just for name editing purposes might >> be overkill, though. >> >> Good luck, >> Ype >> >> _______________________________________________ >> Jython-users mailing list > > Jyt...@li... > > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Ype K. <yk...@xs...> - 2001-09-11 17:09:33
|
D, >On Sun, Sep 09, 2001 at 11:43:57PM +0100, Ype Kingma wrote: >| Frank, >| >| >I'm considering contributing code to NetBeans as an IDE to do Jython script >| >editing. I'm wondering what people are using to edit Jython scripts? > >I too use vim or gvim (depending on whether I want to work in the >console I'm in or a new GUI window). > >| On unix I use vi, on the mac BBEdit, >| and everywhere else any flat text editor. >| I grew up in vi and somehow never needed emacs. Vi has good >| python support under unix (syntax coloring, indentation). > >Which vi are you using? vim has been ported to the mac as well as >almost every other platform. I just can't deal with any other editor >:-). (BTW, I even have gvim built with the GTK+ gui to run in XFree >under cygwin on win2k) I use vim 5.6 (iirc) as it came with suse 6.4 powerpc. Within kde i created a simple shell script to handle window settings, but it doesn't handle mouse clicks as it might. I had to activate the syntax coloring, but that was straightforward. Have fun, Ype |
From: C. P. B. <cpo...@ho...> - 2001-09-11 15:48:47
|
I have been trying to get jython working with a game called robocode, http://robocode.alphaworks.ibm.com/home/home.html The basic idea is that you write a class that inherits from a base class. You write a run function for the default actions, as well as functions such as onScannedRobot that process messages. These virtual robots get put in an arena and try to destroy each other. I have *no* java experience, so I decided to try to get this working with jython. First of all, here's a very simple .java robot: package porter; import robocode.*; public class CPB extends Robot { public void run() while(true) ahead(100); turnGunRight(360); back(100); turnGunRight(360); } } public void onScannedRobot(ScannedRobotEvent e) { fire(1); } } I have no idea what the package porter; line is for, so I ignored it. I added the robocode.jar to my classpath, and tried to translate this java code to python. Here's my python file: from robocode import * class pyrobot(Robot): def run(self): while(1): ahead(100) turnGunRight(360) back(100) turnGunRight(360) def onScannedRobot(self, event): fire(1) I ran that through jythonc, and it compiled, but I got a depracation warning. I recompiled with -deprecation, and here's the output from jythonc: 0932:PWORK://d/robocode/robots/porter$ jythonc pyrobot.py processing pyrobot Required packages: robocode.dialog robocode.jdk13bugfix robocode.editor robocode* Creating adapters: Creating .java files: pyrobot module pyrobot extends robocode.Robot Compiling .java to .class... Compiling with args: ['c://jdk1.3.1_01/bin/javac.exe', '-deprecation', '-classpath', 'C:\\jython-2.0\\jython.jar;.;C:\\Program Files\\proe2000i2\\modchk\\java\\xml\\xml4j.jar;c:\\jython-2.0\\jython.jar;d :\\robocode\\robocode.jar;.\\jpywork;;C:\\jython-2.0\\Tools\\jythonc;d:\\rob ocode\\robots\\porter\\.;C:\\jython-2.0\\Lib;c:\\jython\\lib;C:\\jython-2.0' , '.\\jpywork\\pyrobot.java'] 0 .\jpywork\pyrobot.java:100: warning: jfindattr(org.python.core.PyProxy,java.lang.String) in org.python.core.Py has been deprecated PyObject inst = Py.jfindattr(this, "onScannedRobot"); ^ .\jpywork\pyrobot.java:110: warning: jfindattr(org.python.core.PyProxy,java.lang.String) in org.python.core.Py has been deprecated PyObject inst = Py.jfindattr(this, "run"); ^ 2 warnings When I try to run a robocode battle with this robot, the robocode console gives me the following error: java.lang.NoClassDefFoundError: porter/jpywork/pyrobot (wrong name: pyrobot) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at robocode.JBotsClassLoader.loadRobotClass(JBotsClassLoader.java:55) at robocode.Battle.initialize(Battle.java:350) at robocode.Battle.run(Battle.java:42) at java.lang.Thread.run(Unknown Source) Because of my utter lack of java knowledge, I am completely stuck. Is it even possible to do what I am trying to do? If so, what should I try next? -------------------------------------------------------------------------- C. Porter Bassett cporter at byu dot edu www.et.byu.edu/~porter odigo #: 3854128 ICQ #:38435505 AIM ID: cporterbassett -------------------------------------------------------------------------- "Pretend like this is a really witty saying." - Anonymous -------------------------------------------------------------------------- |
From: Paul G. <pau...@so...> - 2001-09-11 07:37:07
|
I have used the Python mode in XEmacs for years, and I've been very happy with it. However, after seeing Carlos' original posting re: jython for jEdit, I had a look and was *very* impressed. In fact I now use jEdit as my primary development tool. I am doing more Java than [jp]ython, but unlike many Java IDE's, jEdit has a general purpose text editor at it's core, and it supports many programming languages. It is also very easy to extend - using languages that I know (as opposed to elisp, which I don't ;-) -Paul -----Original Message----- From: Carlos Quiroz To: jyt...@li... <mailto:jyt...@li...> Sent: 9/9/01 12:08 PM Subject: Re: [Jython-users] What are Jython folks using to edit? On Sunday 09 September 2001 18:47, Frank Cohen wrote: I made a plugin for including a Jython interpreter in jEdit http://www.jedit.org jEdit is an excellent editor that has Python syntax coloring an quite many other features. I use it normally and I can test the stuff directly Carlos >> I'm considering contributing code to NetBeans as an IDE to do Jython > script >> editing. I'm wondering what people are using to edit Jython scripts? >> >> Information on NetBeans is at http://www.netbeans.org >> Info on my project is at http://www.pushtotest.com >> >> -Frank > |