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: Jerome B. <jer...@xr...> - 2001-05-21 10:21:47
|
Hello, I attempt to make the string.atol('564645646465465L') conversion but I obtained this error trace with JPython 2.0 : merveilles{27} jpython1.1 JPython 1.1 on java1.2.2 (JIT: sunwjit) Copyright (C) 1997-1999 Corporation for National Research Initiatives >>> import string >>> string.atol('564645646465465L') Traceback (innermost last): File "<console>", line 1, in ? File "/opt/Misc/src/Python-1.5.2/Lib/string.py", line 417, in atol ValueError: non-integer argument to string.atol >>> ^D I wonder if this problem is fixed in the JPython 2.0 as it seems to be in the Python 2.0 (is an update usefull) : merveilles{22} python1.5.2 Python 1.5.2 (#31, May 26 1999, 19:10:12) [C] on sunos5 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> import string >>> string.atol('564645646465465L') Traceback (innermost last): File "<stdin>", line 1, in ? ValueError: invalid literal for atol(): 564645646465465L >>> merveilles{20} python2.0 Python 2.0 (#4, Oct 31 2000, 14:29:17) [C] on sunos5 Type "copyright", "credits" or "license" for more information. >>> import string >>> string.atol('564645646465465L') 564645646465465L >>> Thanks, Jerome |
From: Neil R. <ne...@bl...> - 2001-05-21 00:08:56
|
I wrote some Python code that facilitates dynamic class extension at runtime for external and internal method invocations. As part of that, it modifies the __bases__ attribute on classes. Under CPython, this works fine. Jython, though, explicitly does not allow __bases__ to be modified. Just for kicks, I modifed the PyClass.java file to go ahead and allow the modification, and it seems to be happy enough. But I assume there was a reason for not allowing the assignment, and am wondering if there's some particularly nasty Jython scenario lurking out there waiting for me to tickle it? Any insight would be appreciated. Thanks, Neil Computer Science is no more about computers than astronomy is about telescopes. -- E. W. Dijkstra |
From: D-Man <ds...@ri...> - 2001-05-19 03:21:16
|
On Fri, May 18, 2001 at 06:14:35PM -0700, Harlan Hile wrote: ... | > See jythonc --help for more information and more options. | | i discovered i dont need all the @sig stuff to have jythonc work... | i thought i did because i was using jpythonc 1.1, which didnt work. | with 2.0, I can create a java file, put it into my jar, and import | it. unfortunately, importing it doesnt do much. You only need the @sig stuff if you want to access the _classes_ in the python module from a java class. The limitation to classes only (and not module-level stuff) is a result of java. | >>> import session #this comes from session.class | >>> dir(session) | ['main', 'moduleDictInit'] | | what i would like to see is the same thing that comes from a .py file | >>> import session #this comes from session.py | >>> dir(session) | ['ALTERNATE', 'BIGDECIMAL', 'BINARY', 'BOOLEAN', 'DATE', 'NO_WAIT', | 'OTCCHAR', 'OTCDOUBLE', 'OTCLONG', 'OTCLONGLONG', 'OTCSHORT', | 'PARAMETERLIST', 'PRIMARY', 'PyArray', 'PyLong', 'PyString', 'RC_OK', | 'STRING', 'UNDEFINED', 'WAIT_INFINITE', '__file__', '__name__', 'com', | 'createSession', 'createSessionGroup', 'invokemessage', 'java', | 'parameterlist', 'pythonresponselistener', 'resultCodeToString', | 'session', 'sessiongroup', 'statusToString', 'types'] I think this is a result of Java's limitations. If you use (cp|j)ython and import a python module you will see everything in the module when you use dir(). When you use jythonc to generate java bytecodes everything is put into classes because java requires it. Jythonc generates 2 classes -- a class with the name you gave it (a proxy class) and an innerclass that handles the real work. | it looks like the generated java class is meant to be run by java, | and not used from python. Is there a way to make this work without | rewriting my python code in java? Well, the java classes generated by jythonc are basically just calls into the interpreter to have the same effect as executing python source. If you just want to execute python source, you can do that. The source must be in a file on disk. jar files are a Java concoction that allow bundling java bytecodes (.class files) into a single file. The jvm then loads the _java_ classes from the jar file during program execution. The _jvm_ doesn't know anything about python, and thus doesn't load _python_ modules out of jar files. You do _NOT_ need to rewrite your code in java. All you need to do is work with the systems a little more to get a better understanding of how the python and java environments interact and how to get what you really want from it. If you really want everything to be in a jar file then you must use jythonc to generate java classes from your python source, then compile it to java bytecode. Using the --jar and --depends options to jythonc will instruct it to include all the jython classes (the interpreter itself) that your python source/java bytecodes depend on. It doesn't matter that your java code doesn't access these classes -- they must be java bytecode for the jvm to load it from the jar file. If you really want to leave your python source as python source then it can't go into a jar file because the insides of a jar file are not in "sys.path" -- and can't be because (cp|j)ython look to the disk to find the modules. If you do generate java bytecode then note that there are two .class files for each .py file. If your python module is file.py you will get file.class and file$py.class as the output. AFAIK Jython doesn't save any intermediate pyton bytecode like CPython does with the .pyc files. (Though I have noticed that importing a python module creates the java bytecode for the inner class [file$py.class] in the directory next to the python module) HTH, -D |
From: Harlan H. <ha...@ot...> - 2001-05-19 01:14:39
|
On May 18 at 12:03pm, jyt...@li... wrote: > Message: 5 > Date: Fri, 18 May 2001 10:44:58 -0400 > From: D-Man <ds...@ri...> > To: jyt...@li... > Subject: Re: [Jython-users] access to .py's in jars > > On Thu, May 17, 2001 at 07:26:36PM -0700, Harlan Hile wrote: > ... > | what i want to do now is bundle it all into a jar file... so, include all > | my com/otelnet/.class files, and then include a mymod.py at the root, or a > | mymod$py.class at the root, so when I have the jar in the classpath, i can > | import mymod > ... > | is there a way to do this? > > Use 'jythonc --jar' to build the jar file. Putting .py files into a > jar doesn't help at all. You need to have java bytecodes (.class) > files in the jar. You also need all the jython internals stuff that > your python code depends on in the jar as well (or any jar as long as > it is in the CLASSPATH). > > See jythonc --help for more information and more options. i discovered i dont need all the @sig stuff to have jythonc work... i thought i did because i was using jpythonc 1.1, which didnt work. with 2.0, I can create a java file, put it into my jar, and import it. unfortunately, importing it doesnt do much. >>> import session #this comes from session.class >>> dir(session) ['main', 'moduleDictInit'] what i would like to see is the same thing that comes from a .py file >>> import session #this comes from session.py >>> dir(session) ['ALTERNATE', 'BIGDECIMAL', 'BINARY', 'BOOLEAN', 'DATE', 'NO_WAIT', 'OTCCHAR', 'OTCDOUBLE', 'OTCLONG', 'OTCLONGLONG', 'OTCSHORT', 'PARAMETERLIST', 'PRIMARY', 'PyArray', 'PyLong', 'PyString', 'RC_OK', 'STRING', 'UNDEFINED', 'WAIT_INFINITE', '__file__', '__name__', 'com', 'createSession', 'createSessionGroup', 'invokemessage', 'java', 'parameterlist', 'pythonresponselistener', 'resultCodeToString', 'session', 'sessiongroup', 'statusToString', 'types'] it looks like the generated java class is meant to be run by java, and not used from python. Is there a way to make this work without rewriting my python code in java? ---- ha...@ot... x293 http://65.0.250.62/ |
From: Harlan H. <ha...@ot...> - 2001-05-18 23:08:41
|
> Date: Fri, 18 May 2001 10:44:58 -0400 > From: D-Man <ds...@ri...> > To: jyt...@li... > Subject: Re: [Jython-users] access to .py's in jars > > On Thu, May 17, 2001 at 07:26:36PM -0700, Harlan Hile wrote: > ... > | what i want to do now is bundle it all into a jar file... so, include all > | my com/otelnet/.class files, and then include a mymod.py at the root, or a > | mymod$py.class at the root, so when I have the jar in the classpath, i can > | import mymod > ... > | is there a way to do this? > > Use 'jythonc --jar' to build the jar file. Putting .py files into a > jar doesn't help at all. You need to have java bytecodes (.class) > files in the jar. You also need all the jython internals stuff that > your python code depends on in the jar as well (or any jar as long as > it is in the CLASSPATH). jythonc compiles a .py into a real java class, right? I dont want a real java class.. it doesnt need to be accessible from java, only from python. this is why i originally included the generated file$py.class (which i assume is similar to cpython's .pyc files), but that didnt work. does jpython only look for real java classes in jar files, and not python class files? If that is the case and i do need to generate a real java class, what is the minimum i can put into the @sig tags so it works? should everything be java.lang.Object, or org.python.core.PyObject...? or is there a bundling mechanism other than jar that works with jython? ---- ha...@ot... x293 |
From: D-Man <ds...@ri...> - 2001-05-18 14:45:02
|
On Thu, May 17, 2001 at 07:26:36PM -0700, Harlan Hile wrote: ... | what i want to do now is bundle it all into a jar file... so, include all | my com/otelnet/.class files, and then include a mymod.py at the root, or a | mymod$py.class at the root, so when I have the jar in the classpath, i can | import mymod ... | is there a way to do this? Use 'jythonc --jar' to build the jar file. Putting .py files into a jar doesn't help at all. You need to have java bytecodes (.class) files in the jar. You also need all the jython internals stuff that your python code depends on in the jar as well (or any jar as long as it is in the CLASSPATH). See jythonc --help for more information and more options. HTH, -D |
From: Paul G. <pau...@so...> - 2001-05-18 07:17:56
|
I used to get the warining 'import exceptions' failed; using string-based exceptions every time I ran a jpython application that was staticly compiled into Java code. It stopped when I explicitly added the module exceptions.py. It seems that this module is not explicitly imported anywhere, but at some point the jpython tries to dynamicly load this module an issues the warning if the attempt fails. Since it is not statically imported anywhere, it does not automaitcally get included in a 'freeze', even if you specify the --deep option to jpythonc. If you compile $PYTHON_HOME/Lib/exceptions.py into java bytecode and include it in your classpath, this will probably make the problem go away. I have only done this with jpython1.1, but ifyou are having this problem with jython2.x, then I imagine that is it the same issue. Below is a segemnt of my ANT config file that we use to statically compile a piece of JPYthon code called servermon.py. Note that "${tool.jpython}/Lib/exceptions.py" is explicitly added on the second to last line. It my help for reference (even though you are probably not using jythonc). <property name="python.home" value="${tool.jpython}"/> <java classname="org.python.util.jpython" fork="yes" classpath="${classpath.compile.adminapi}:${tool.jpython}\jpython.jar" args="${tool.jpython}/Tools/jpythonc2/jpythonc.py --deep --package ch.softwired.msrv.tools.servermon --workdir ${build.src.java} --compiler NONE ${src.python}/ch/softwired/msrv/tools/servermon/servermon.py ${tool.jpython}/Lib/exceptions.py " > </java> Hope this helps. -Paul > Message: 2 > Date: 14 May 2001 09:35:27 -0700 > To: jyt...@li... > From: xn...@sp... > Subject: [Jython-users] InteractiveConsole question > > I have a class that extends InteractiveConsole. > I'm using it to pass administrative commands > to my Java codebase. > > Everything works great except this: > > I get - > 'import exceptions' failed; using string-based exceptions > > this message even though my command does get > passed to my admin framework. > > How do I suppress the above ?? any ideas ?? > > I tried setting using setOut and setErr methods > to some temp file, but that did not help. > > -thanks, > neo > |
From: <Arm...@t-...> - 2001-05-18 07:02:22
|
Hi Samuele, Samuele Pedroni schrieb: > Under w2k one can put a personal .jython file (contents as the registry) > under Documents and Settings/*user-name* (or something like that) > in NT there should be something similar, just start jython > and ask: > > from java.lang import System > System.getProperty("user.home") > > in that directory you can put your .jython file and deduce the general > case <wink> That was my first guess. So, I copied .jython from Linux to registry in C:\winnt\profiles\armin which is the value of user.home. Didn't work. It only works when the registry file is in Jython's installation directory. Regards AE |
From: Harlan H. <ha...@ot...> - 2001-05-18 02:26:42
|
I have a collection of java class files that I want to add a layer of python to, to make it look more python-like. for instance, a bit of python code makes my java class act like a python dictionary. what i want to do now is bundle it all into a jar file... so, include all my com/otelnet/.class files, and then include a mymod.py at the root, or a mymod$py.class at the root, so when I have the jar in the classpath, i can import mymod this doesnt work. I've also tried putting an __init__.py in the jarfile, and import <jarfilename> but this doesnt work either. is there a way to do this? any help is appreciated. |
From: Robert W. B. <rb...@di...> - 2001-05-18 00:27:10
|
Hello, I'm curious about the underscore import restriction- e.g, >>> from A import * when objects within "A" begin with a single underscore. CPython excludes those objects prefixed with a single underscore, while Jython excludes those with 2 prefixing underscores only. I didn't see anything on "differences.html," in the bug-list, in mail archives, nor code comment that indicates this is intended. Sorry if I've overlooked the obvious, but I was hoping someone could tell me if this is expected behavior, or if it could change anytime soon. On an unrelated note... I hadn't heard back about the hexstring conversion in "long("0xaf",16)" note sent a while back. It's not important, but I was curious if this change is being considered. The note is at: http://www.geocrawler.com/archives/3/7018/2001/4/0/5655184/ Thanks, Robert |
From: Shae E. <sh...@we...> - 2001-05-17 15:14:20
|
I don't know if this is useful or interesting to anyone else, but I got Jython 2.0 running on the Nokia 9210 mobile phone emulator yesterday after 20 minutes of trying. Since that will now save me many many hours of work, I must express my intense gratitude and happiness to everyone that's worked on Jython. ---- Shae Matijs Erisson - http://www.webwitches.com/~shae/ |
From: Jeff E. <je...@ad...> - 2001-05-17 13:46:36
|
Waclawczyk Janusch wrote: > cb = JComboBox(["VAL1"]) > cb.actionPerformed = action # ERROR > Traceback (innermost last): > File "<console>", line 1, in ? > TypeError: can't assign to this attribute in java instance: actionPerformed > > Is this a bug? No, its an ambiguity. JComboBox has a method named actionPerformed because it implements ActionListener. Most other classes that accept ActionListeners don't also implement ActionListener, so they don't have that problem. There are other cases where assigning to the automatic bean properties also fails because the property or event name conflicts with a method or field. The workaround would be to actually implement an ActionListener and add it to the JComboBox as you would in Java. Jeff Emanuel Landmark Graphics Corporation je...@ad... |
From: Waclawczyk J. <Jan...@ic...> - 2001-05-17 07:13:37
|
Hello, I've got following problem: from javax.swing import JButton, JComboBox from java.awt import * def action(e): print "test" button = Button("Press") button.actionPerformed = action # IT WORKS cb = JComboBox(["VAL1"]) cb.actionPerformed = action # ERROR Traceback (innermost last): File "<console>", line 1, in ? TypeError: can't assign to this attribute in java instance: actionPerformed #but the following works class AL(ActionListener): def actionPerformed(self, e): print "jan" al = AL() cb.addActionListener(al) Is this a bug? Regards Janusz Waclawczyk |
From: Chris M. <ch...@hd...> - 2001-05-16 13:36:31
|
On Wed, May 16, 2001 at 03:06:21PM +0200, Wil...@FI... wrote: > > this might be me just being really dim, but... > > why can't i do... > > cba=123 > abc='abc'+cba cba at this point is an integer and you can't concatenate an integer and a string. Something like this would work: cba=123 abc=abc+str(cba) HTH Chris > > ...to make a string with value 'abc123' `? > what can i do instead ? > > i.e. if a have a variable that always has an integer value, and i want to > append this integer to the end of a string... > > - will > > > ************************************************************************************************** > ** eSafe scanned this email for viruses, vandals and malicious content ** > ************************************************************************************************** > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users -- Chris Meyers 7941 Tree Lane Suite 200 Madison WI 53717 |
From: charles F s. <yr...@ya...> - 2001-05-16 13:34:04
|
Hello Will, Here's a capture of a console session that shows (I think) what you want to do. just put the reverse quote character (my term, its to the left of the 1 key) before and after the variable holding the number. >>> cba = 123 >>> abc = 'abc' + cba Traceback (most recent call last): TypeError: __add__ nor __radd__ defined for these operands >>> abc = 'abc' + `cba` >>> print abc abc123 regards, charles simons --- Wil...@FI... wrote: > > this might be me just being really dim, but... > > why can't i do... > > cba=123 > abc='abc'+cba > > ...to make a string with value 'abc123' `? > what can i do instead ? > > i.e. if a have a variable that always has an integer > value, and i want to > append this integer to the end of a string... > > - will > > > ************************************************************************************************** > ** eSafe scanned this email for viruses, vandals and > malicious content ** > ************************************************************************************************** > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/ |
From: Samuele P. <pe...@in...> - 2001-05-16 13:31:56
|
> > this might be me just being really dim, but... > > why can't i do... > > cba=123 > abc='abc'+cba > > ...to make a string with value 'abc123' `? > what can i do instead ? > > i.e. if a have a variable that always has an integer value, and i want to > append this integer to the end of a string... > > - will > In this respect jython/python is different from java (and perl): cba=123 abc='abc'+`cba` or equivalently abc='abc'+repr(cba) (but with cba=2L (long int) you will get `abc2L`) or abc = 'abc' + str(cba) (here with 2L one gets `abc2`) or abc="abc%s" % a regards, Samuele Pedroni |
From: <Wil...@FI...> - 2001-05-16 13:15:52
|
this might be me just being really dim, but... why can't i do... cba=123 abc='abc'+cba ...to make a string with value 'abc123' `? what can i do instead ? i.e. if a have a variable that always has an integer value, and i want to append this integer to the end of a string... - will ************************************************************************************************** ** eSafe scanned this email for viruses, vandals and malicious content ** ************************************************************************************************** |
From: Ben H. <Ben...@fi...> - 2001-05-16 10:43:12
|
[Cross-posted to Jython list from Netbeans devel, addressing JPython tool support - FYI only] Thanks Peter, David for your encouraging responses. Stepping back for a moment to a broader view, I see two potential purposes/directions for the JPython scripting features in Netbeans. 1. JPython scripting is a conveinient language to write small java-oriented scripts and to automate IDE operation. 2. JPython is an implementation of the powerful and increasingly popular language Python, and the scripting module brings initial support for Python language development to Netbeans. At a guess, I expect the current scope and intent of the scripting module support is more towards option 1: a way of scripting Java, because the IDE is Java based, (rather than a way to develop python, which occurred just as a side effect). But I would very much like to develop (J)Python in Netbeans. There is currently no IDE specifically for JPython development available - the main Python development environments are geared towards C-Python. And because JPython is executable java bytecode and thus allows effortless creation and use of java objects throughout the code, it makes sense to develop it in a java oriented IDE. To try to capture what might be required to realize option 2, ordered roughly in order of (desirability / difficulty to add): * Support for editing, running Jython code (present now) * Facility to manage important JPython properties, eg python.home in IDE. * Support for compiling and packaging JPython-based Jars * Full JPython standard libraries including python libs (/lib/*.py files) installed *Option to view truncated exception traces showing only user code stack segment, (ie only section running inside users program entry point.) * Syntax highlighting recognizes python keywords, comments, etc * Improved reporting of exceptions and errors to link code location references in messages to the editor buffer ala Java. * Code completion allowing the user to see imported members from both java and python libraries (which implies comprehension of mounted *.py files as python modules.) * Facility to auto-update the installed Jython version from a Jython site update * Debugging support (seems hard but might not be - basically about mapping between executing java bytecode and corresponding JPython source statement). So now you know my true agenda :) Sounds almost like a separate module is needed. Now, I appreciate I might be the only one who wants this, and might have to do it if I want it. But at least, I would want to coordinate such an effort, which greatly extends the scope of an existing feature, with the scripting module group to avoid working at cross-purposes. Regards Ben ----- Original Message ----- From: "Peter Zavadsky" <pet...@cz...> To: <nb...@ne...> Sent: Wednesday, May 16, 2001 8:50 AM Subject: Re: [nbdev] Using Scripting module for JPython > Hi, > > David Strupl wrote: > > > Ben Hutchison wrote: > > > >> Some comments and requests for the scripting module & JPython. > > > > > > Thanks for trying! My comments inlined: > > > > > >> I mainly use this module for the support it gives for editing and > >> running > >> JPython code. Im not a scripting module expert so some comments below > >> may be the > >> result of ignorance as to how to configure it. > >> > >> 1. Firstly, the default library packaged with Netbeans now, > >> JPython.jar, appears > >> to be quite out of date, given that the last release of JPython, 1.1, > >> was 14 > >> months ago! The project has changed name to Jython, latest release > >> 2.1a, and is > >> now Python 2.0 compatible. > > > > > > The new version (jython) is (AFAIK) already in the latest dev builds. > > You can get the new sources from CVS (main trunk), extra binaries from > > the download page and try to build the module for your self. > > Yes if you use dev builds is already there. > > > > > We plan to put the updated version on the autoupdate. Please ask > > Pet...@cz... about this. > > I have to ask about this and when it will be done let you inform. > > > > > > >> 2. To replace the JPython version, I switched the jar in the /lib/ext > >> directory, > >> restarted, and that appeared to work fine. Could this issue - > >> upgrading script > >> engines - be defined/documented please? (Im happy to contribute a > >> section for > >> Jython if needed). > > > Well it works since the Jython is compatible with JPython but shouldn't > be the most proper way since the lib/ext directory isn't > the right location for module binaries. So its better not mention this > tricky way in doc's, preffered way is the autoupdate one. > > > > > Any contribution is welcomed. Peter already moved the (new) jar to > > modules/ext. You can patch the description pages with updated info, > > create a task in issuezilla and attach the patches there. Peter or me > > will apply your patches. > > Yes Ben, your contributions are welcome. Feel free to send any > improvements to about jython and I'll be happy to put them into module. > > >> 3. There are some important properties that control Jython behavior > >> which are > >> typically specified in a registry file, which is searched for through > >> the > >> property "python.home", but can be overridden when creating a > >> PythonInterpreter > >> engine. I would like to see better support for either; a) specifying a > >> python.home from within Netbeans, or b) passing python properties > >> directly to > >> the interpreter. > >> > >> Re: option b above, the code below, from > >> org.netbeans.modules.scripting.JPythonScriptType would need to be > >> changed so > >> that the interpreter was initialized with a property set from a > >> netbeans GUI > >> form or something. > >> > >> private PythonInterpreter getInterpreter() { > >> if(pythonInterpreter == null) { > >> System.setProperty("python.cachedir", > >> System.getProperty("netbeans.user") + > >> "/system/jpythoncachedir"); > >> pythonInterpreter = new PythonInterpreter(); // <<< add > >> parameters > >> > > > > You have two options here: either create and test the requested > > patches and attach them to a issuezilla task or try to persuade Peter > > to do it for you. > > Thank you for point out this thing. > You don't have to persuade me, I see you are right. > > (Please submit an enhancement about this into issuezilla, or I'll do > that if you don't. > You'll be then informed about changes of the issue.) > > I'll have a look on it and try find some solution. The a) solution > should be easy, there is a possibility > to pass any properties to IDE when starting, for our case using > -J-Dpython.home=..., but of course its necessary to read the property in > the code :-). > I'll do that. > The second b) option -> I have to find which set of properties is useful > for jython and how to customize them. > > > > > > >> 4. There are a large nunber of python modules shipped with JPython > >> that normally > >> reside in the <JPython home>/lib directory that arent in the Netbeans > >> dist. > >> Essentially, jpython.jar is just the core and not the whole of the > >> jpython > >> system: it supports using the language syntax but not the standard > >> python APIs. > >> Granted, for some people this is all they want, but if people like me > >> want to do > >> Python development in Netbeans, they'll need the modules. > > > >> 5. Keyword highlighting in editor seems based upon Java and not > >> Python language. > >> > >> 6. Code completion likewise > >> > To the above points. I have to think about them what are the > possibilities to implement them. > > > > > Oh yes. Even more work to be done. > > > > > >> 7. In the scripting plan doc, I would have to add some > >> sub-requirements to > >> section 1.2.1 "New Console". > >> * Output appears in the console or just below. > >> * A option to truncate stack traces or send them to a different > >> window. They > >> can be very long with the majority of the stack in netbeans and python > >> interpeter and not user code. > > > I'll add those hints to the page. > > >> > >> I know there arent quick and easy fixes for many of these issues, but > >> I would > >> like to at least discuss possible solutions. > >> > Thanks as well for the many ideas. Any help from your side is welcome. > > All the best > > Peter > > -- > > Peter Zavadsky > Sun Microsystems Czech s.r.o. > http://www.netbeans.org > > |
From: Samuele P. <pe...@in...> - 2001-05-15 12:11:20
|
Hi. [Armin Ehrenfels] >... But, what about personal > registry files, very important, IMO, on WTS ? Under w2k one can put a personal .jython file (contents as the registry) under Documents and Settings/*user-name* (or something like that) in NT there should be something similar, just start jython and ask: from java.lang import System System.getProperty("user.home") in that directory you can put your .jython file and deduce the general case <wink> regards, Samuele Pedroni |
From: Rodrigo S. <rod...@co...> - 2001-05-15 01:35:07
|
Hello folks, I recently succeded in running JPython 1.1 over Kaffe 1.0.6. Soon after that I realised JPython was defunct, then I turned to Jython 2.1.a1. It loads the intrepreter almost without complain (it complains about some jars in my CLASSPATH) and it does not print copyright notice ??? Moreover, import java fails with: $ jython *sys-package-mgr*: processing modified jar, '/home/rodrigo/Tese/work/lib/gnu-regexp-1.1.0.jar' *sys-package-mgr*: skipping bad jar, '/home/rodrigo/Tese/work/lib/gnu-regexp-1.1.0.jar' *sys-package-mgr*: processing modified jar, '/usr/share/mysql/mm.mysql.jdbc-2.0pre5/mysql_both_comp.jar' *sys-package-mgr*: skipping bad jar, '/usr/share/mysql/mm.mysql.jdbc-2.0pre5/mysql_both_comp.jar' Jython 2.1a1 on java1.0.6-20010401 (JIT: kaffe.jit) >>> import java Traceback (innermost last): File "<console>", line 1, in ? ImportError: no module named java >>> import sys >>> print sys.path ['', '.', '/usr/local/jython-2.1a1/Lib'] >>> Over jdk1.3 it goes fine! I saw an observation in Jython's Home specifically related to Kaffe (absence of BigInteger). Nevertheless, I thought that was rather old and doesn't seem to be the problem now. How could I debug jython to pinpoint the problem ? Any clues ? TIA Rod -- Rodrigo Senra Computer Engineer (GPr Sistemas Ltda) rod...@gp... MSc Student (IC - UNICAMP) Rod...@ic... Home Page http://www.ic.unicamp.br/~921234 (ICQ 114477550) |
From: <bc...@wo...> - 2001-05-14 22:10:51
|
[Robert] >It looks like Java field access is outside the proxy, but I'm >afraid I've overlooked something. Is it true that >fields are outside of proxy making protected field=private >in Jython even when subclassing? That is unfortunately correct. Protected fields in java super classes are not accesible in python subclasses. The workarounds so far are adding getter methods to the java class or using respectJavaAccessibility. regards, finn |
From: <xn...@sp...> - 2001-05-14 16:35:35
|
I have a class that extends InteractiveConsole. I'm using it to pass administrative commands to my Java codebase. Everything works great except this: I get - 'import exceptions' failed; using string-based exceptions this message even though my command does get passed to my admin framework. How do I suppress the above ?? any ideas ?? I tried setting using setOut and setErr methods to some temp file, but that did not help. -thanks, neo ___________________________________________________________________ Join the Space Program: Get FREE E-mail at http://www.space.com. |
From: Robert W. B. <rb...@di...> - 2001-05-14 13:46:19
|
Hello all, It looks like Java field access is outside the proxy, but I'm afraid I've overlooked something. Is it true that fields are outside of proxy making protected field=private in Jython even when subclassing? tnx, Robert |
From: Deirdre S. M. <de...@de...> - 2001-05-12 04:42:44
|
Based on some of the stuff that Steven Majewski did, trying to create a Cocoa app that loads a nib from Jython. When running, I get the following errors: % jython CurrencyConverter.jy ( NSBundle </System/Library/Frameworks/Foundation.framework> (loaded), NSBundle </usr/lib> (loaded), NSBundle </System/Library/Frameworks/JavaVM.framework> (loaded), NSBundle </usr/lib/java> (loaded) ) ./build/CurrencyConverter2.app May 11 21:35:32 java[1110] Unknown class `ConverterController' in nib file, using `NSObject' instead. May 11 21:35:32 java[1110] Unknown class `Converter' in nib file, using `NSObject' instead. May 11 21:35:32 java[1110] Could not connect the action convert: to target of class NSObject So...why doesn't it know about the classes? #!/usr/bin/env jython from com.apple.cocoa.foundation import * from com.apple.cocoa.application import * MyApp = None _pools = [] tpath = './TempConverter/build/TempConverter.app' cpath = './build/CurrencyConverter2.app' class Converter(NSObject): def convert(amount, rate): return (amount * rate) class ConverterController(NSObject): def __init__(): self.converter = Converter() self.dollarField = NSTextField() self.rateField = NSTextField() self.totalField = NSTextField() def convert(sender): rate = self.rateField.floatValue(); amount = self.dollarField.floatValue(); total = converter.convert(amount, rate); self.totalField.setFloatValue(total); def xxx(): print NSBundle.allFrameworks() def Pool(): global _pools tmp = NSAutoreleasePool.push() _pools.append(tmp) return tmp def App(): global MyApp MyApp = NSApplication.sharedApplication() return MyApp def Bundle( path=cpath ): print path return NSBundle.bundleWithPath( path ) xxx() pool = Pool() myapp = App() bndl = Bundle() nib = NSApplication.loadNibFromBundle( bndl, 'MainMenu', myapp ) if __name__ == '__main__' : myapp.run() |
From: Jason F. <jaf...@en...> - 2001-05-12 01:14:41
|
Hello, I'm currently trying to graft Jython into the Cocoon2 web publishing framework using IBM's Bean Scripting Framework. So far it has been a straightforward process, so kudos to the Jython team. If you're interested, check out xml.apache.org/cocoon and take a look at ScriptGenerator. Everything works great so long as all of the python code is within a single script. As previous posts have mentioned, as soon as I try to import from another file jython complains about not being able to find the resource in question. The solution presented earlier (in the context of the JythonServlet?), namely to use sys.add_package(), sounds like a good solution if you have control of the servlet. Unfortunately given the number of toolkits and classloaders I'm working with I don't have this option. I was wondering whether or not it would be possible to do something similar to sys.add_package() from within a python script? I tried this (naively) and was told that "sys" wasn't a known name. My idea is that I know, as developer, that a class with a certain name is available somehow. I'm not sure that this solution would work, given that Tomcat and Cocoon2 for sure have their own classloaders and the BSF might as well, but it's the only one I can think of. I *really* don't want to add things to my system classpath if I don't have to. As an aside, since I've been out of Java programming for so long, can I set that various jython parameters programmatically as opposed to having to use "-D" on the command line? Thanks for any help! Jason Foster |