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: Yang W. <yw...@pr...> - 2002-02-12 18:32:12
|
Kevin, Thanks for your reponse. Of the two suggestions, the first one got me an error: >>> import java >>> import java.lang >>> import os >>> java.lang.Runtime.getRuntime().exec("start StartDmServices.bat") Traceback (innermost last): File "<console>", line 1, in ? java.io.IOException: CreateProcess: start StartDmServices.bat error=3D2 at java.lang.Win32Process.create(Native Method) at java.lang.Win32Process.<init>(Win32Process.java:66) at java.lang.Runtime.execInternal(Native Method) at java.lang.Runtime.exec(Runtime.java:551) at java.lang.Runtime.exec(Runtime.java:418) at java.lang.Runtime.exec(Runtime.java:361) at java.lang.Runtime.exec(Runtime.java:325) at java.lang.reflect.Method.invoke(Native Method) at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java ) at org.python.core.PyMethod.__call__(PyMethod.java) at org.python.core.PyObject.__call__(PyObject.java) at org.python.core.PyInstance.invoke(PyInstance.java) at org.python.pycode._pyx5.f$0(<console>:1) at org.python.pycode._pyx5.call_function(<console>) at org.python.core.PyTableCode.call(PyTableCode.java) at org.python.core.PyCode.call(PyCode.java) at org.python.core.Py.runCode(Py.java) at org.python.core.Py.exec(Py.java) at org.python.util.PythonInterpreter.exec(PythonInterpreter.java) at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter .java) at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpret er.java) at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpret er.java) at org.python.util.InteractiveConsole.push(InteractiveConsole.java) at org.python.util.InteractiveConsole.interact(InteractiveConsole.java) at org.python.util.jython.main(jython.java) java.io.IOException: java.io.IOException: CreateProcess: start StartDmServices.b at error=3D2 I did "start StartDmServices.bat" in DOS window and it works. Then I used a non existing bat file and surprise, got the same error: >>> java.lang.Runtime.getRuntime().exec("start NoExist.bat") Traceback (innermost last): File "<console>", line 1, in ? java.io.IOException: CreateProcess: start NoExist.bat error=3D2 at java.lang.Win32Process.create(Native Method) at java.lang.Win32Process.<init>(Win32Process.java:66) at java.lang.Runtime.execInternal(Native Method) at java.lang.Runtime.exec(Runtime.java:551) at java.lang.Runtime.exec(Runtime.java:418) at java.lang.Runtime.exec(Runtime.java:361) at java.lang.Runtime.exec(Runtime.java:325) at java.lang.reflect.Method.invoke(Native Method) at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java ) at org.python.core.PyMethod.__call__(PyMethod.java) at org.python.core.PyObject.__call__(PyObject.java) at org.python.core.PyInstance.invoke(PyInstance.java) at org.python.pycode._pyx6.f$0(<console>:1) at org.python.pycode._pyx6.call_function(<console>) at org.python.core.PyTableCode.call(PyTableCode.java) at org.python.core.PyCode.call(PyCode.java) at org.python.core.Py.runCode(Py.java) at org.python.core.Py.exec(Py.java) at org.python.util.PythonInterpreter.exec(PythonInterpreter.java) at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter .java) at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpret er.java) at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpret er.java) at org.python.util.InteractiveConsole.push(InteractiveConsole.java) at org.python.util.InteractiveConsole.interact(InteractiveConsole.java) at org.python.util.jython.main(jython.java) java.io.IOException: java.io.IOException: CreateProcess: start NoExist.bat error =3D2 But I checked the bat file name again and again and with cap/uncap. All got the same error. I really appreciate if you can point to what I did wrong. Thanks! BTW, the second method (start a new thread) works but the problem is that the output crowds the window. It is kind of inconvenient when working in interactive mode. Yang -----Original Message----- From: Kevin Butler [mailto:kb...@ca...] Sent: Monday, February 11, 2002 7:53 AM To: Yang Wang Cc: jyt...@li... Subject: Re: [Jython-users] start a Window2K program in a separate window andbackto Jython Yang Wang wrote: >=20 > Hi All, >=20 > I am trying to use os.system("start mine.bat") to start a program in a > separate window. But the problem is that the control remains in the new > window and did not go back to the Jython window at all. Until I exit > the "mine.bat", the prompt in Jython began to show up. From "help start" on NT/4: > When executing an application that is a 32-bit GUI application, CMD.EXE > does not wait for the application to terminate before returning to > the command prompt. This new behavior does NOT occur if executing > within a command script. > Did I use the right command to do this? =20 Yes. Maybe. system() starts a command and waits for it to complete. > I looked at other Python > commands such as os.execl() but when I try it on Jython, it would say > that "AttributeError: class 'org.python.modules.os' has no attribute > 'execl'". RSN I'll implement the os.exec() functions, but I haven't gotten around to it yet. Currently, to have your app continue running after launching the command, you can either: - run the command as java.lang.runtime.getRuntime().exec([ "cmd.exe", "/c", "mine.bat" ]) - run system in a separate thread as thread.start_new_thread( os.system, ("mine.bat",)) Note that either approach may leave your jython application without the focus (depends on what the MS Window Manager decides to do), so you may need to add a "setFocus" command to your jython GUI application. kb _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Kevin B. <kb...@ca...> - 2002-02-12 17:49:02
|
(expression) is a parenthized expression, not a tuple. Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> type( (1) ) <type 'int'> >>> type( (1,) ) <type 'tuple'> >>> Funky syntax, but you really don't want (5 + 10) to be a tuple. kb "Russo, Tom" wrote: > > Hi, > > When I run the following: > > <file name="demo.py"> > import thread > > thread.start_new_thread(lambda x,y:(x,y), (1,2)) # succeeds > thread.start_new_thread(lambda x:x, (1)) # fails > </file> > > I get: > > <output> > Traceback (innermost last): > File "demo.py", line 4, in ? > TypeError: start_new_thread(): 2nd arg can't be coerced to > org.python.core.PyTuple > </output> > > Is there some reason I should be able to use a function of two arguments > when starting a thread, but not a function of one argument? Does jython not > recognize (1) as a tuple in this case? > > thanks > _t > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Russo, T. <to...@st...> - 2002-02-12 17:43:30
|
Hi, When I run the following: <file name="demo.py"> import thread thread.start_new_thread(lambda x,y:(x,y), (1,2)) # succeeds thread.start_new_thread(lambda x:x, (1)) # fails </file> I get: <output> Traceback (innermost last): File "demo.py", line 4, in ? TypeError: start_new_thread(): 2nd arg can't be coerced to org.python.core.PyTuple </output> Is there some reason I should be able to use a function of two arguments when starting a thread, but not a function of one argument? Does jython not recognize (1) as a tuple in this case? thanks _t |
From: Ype K. <yk...@xs...> - 2002-02-11 19:53:52
|
Doug, >I'm using the re module with Jython embedded in my Java app to handle the >pattern matching. I'm struggling with the regular expression syntax to >perform a negation of a pattern. Specifically, for a date I want to allow >DD-MMM-YY (JAN, MAR,etc for the month value) so I want my match object to >be returned only for items that don't match this pattern. > > r=re.compile('[0123][0-9][-]\w{3}[-][01][0123]').search("12-DEC-02") >//this returns a match object > >How can I wrapper this pattern and negate it so the failure to find the >pattern is what is returned? > >I've tried variations similar to the snippet below to group and negate >without success. >r=re.compile('^([0123][0-9][-]\w{3}[-][01][0123])').search("12-DEC-02") > >I have looked at the Mastering Regular Expressions book which is some help >but is heavily Perl slanted. The re module documentation doesn't delve >into my particular issue sufficiently (or I just missed it). Any >recommendations for additional reference resources in addition to some help >with the current problem would be welcome. Did you consider java's date formatter? I think it does exactly what you want: http://java.sun.com/j2se/1.4/docs/api/java/text/DateFormat.html You'll have to catch the ParseException from the parse() method to handle the failure to find the pattern. Good luck, Ype -- |
From: Ype K. <yk...@xs...> - 2002-02-11 19:01:57
|
leon, >On Wed, Feb 06, 2002 at 03:08:55PM +0200, leon j. breedt wrote: >> i need to make all the classes in a specific package available >> to Jython script code without the code having to qualify the >> class names. >it seems doing an exec() against the namespace works just as well.. >simplest solution best i guess :) I missed the first message, so I hope this is stil relevant: You can use the standard function __import() before actually executing your code. for all modnames: interpr.exec(modName + " = __import('" + pkgSubkpg + '.' + modName + "')") and then: interpr.exec(yourCode) Have fun, Ype -- |
From: rpcee <rp...@op...> - 2002-02-11 18:39:30
|
not an re expert, but grep solves this with -v flag (ie it looks for a match + copies lines that don't), and also unsure what you're input is - a list? ie do you want: [s for s in mylist if not r.match(s)] where mylist contains a list of dates and you want to create a list containing those not matching your re. there's also negation lookahead, I think re.compile('(?!xxx).*'); where xxx is your regular expression below, means: match anything (the .*) but only if the lookahead does not match your re. which I found at a regular expression how to http://py-howto.sourceforge.net/regex/node16.html |
From: <Dou...@gr...> - 2002-02-11 16:28:55
|
I'm using the re module with Jython embedded in my Java app to handle the pattern matching. I'm struggling with the regular expression syntax to perform a negation of a pattern. Specifically, for a date I want to allow DD-MMM-YY (JAN, MAR,etc for the month value) so I want my match object to be returned only for items that don't match this pattern. r=re.compile('[0123][0-9][-]\w{3}[-][01][0123]').search("12-DEC-02") //this returns a match object How can I wrapper this pattern and negate it so the failure to find the pattern is what is returned? I've tried variations similar to the snippet below to group and negate without success. r=re.compile('^([0123][0-9][-]\w{3}[-][01][0123])').search("12-DEC-02") I have looked at the Mastering Regular Expressions book which is some help but is heavily Perl slanted. The re module documentation doesn't delve into my particular issue sufficiently (or I just missed it). Any recommendations for additional reference resources in addition to some help with the current problem would be welcome. Thanks, Doug |
From: Kevin B. <kb...@ca...> - 2002-02-11 16:13:21
|
Frank, You're pretty well limited in Jython to what you can do in Java. This means you can: - use ENTER as the key to end the loop (easiest, most portable) (call raw_input in a separate thread) - write a GUI that detects the keypress event (second easiest, second most portable) - call native code that detects the keypress (hardest, least portable, but most similar to what you're doing in CPython) kb Frank Cohen wrote: > > I'm writing a Jython program that repeats an operation over and over again. > I'd like to sense for any key on the keyboard being pressed to end the loop. > Python (C) on Windows has the msvcrt library which provides some useful MS > Visual C functions. Is there such a thing for Jython? -Frank > > -- > Frank Cohen, CEO, PushToTest, www.pushtotest.com, phone: 408 374 7426 > Come to PushToTest for free open-source Active Security solutions that test, > monitor and automate Web Service systems for functionality, scalability and > performance. > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Kevin B. <kb...@ca...> - 2002-02-11 16:00:38
|
The problem is you don't have MyClass or MyObject in the Python namespace. import org.python.util.PythonInterpreter; import org.python.core.*; public class Te { public static void main(String []args) throws PyException { PythonInterpreter interp = new PythonInterpreter(); MyClass MyObject = new MyClass(); // A class created by me // how do I do this? interp.set( "MyObject", MyObject ); interp.exec("MyObject.doSomething()"); // or interp.set( "MyClass", MyClass.class ); interp.exec( "MyClass().doSomething()" ); } } class MyClass { public void doSomething() {} } kb > John Young wrote: > > quick question with embedding jython.... in the following example (from the embedding 'tutorial' at jython.org) > how do I access MyClass from within the python code? > > > import org.python.util.PythonInterpreter; > import org.python.core.*; > > public class SimpleEmbedded { > public static void main(String []args) throws PyException > { > PythonInterpreter interp = new PythonInterpreter(); > MyClass MyObject = new MyClass(); // A class created by me > > System.out.println("Hello, brave new world"); > interp.exec("import sys"); > interp.exec("print sys"); > > // how do I do this? > // interp.exec("MyObject.doSomething()"); > > interp.set("a", new PyInteger(42)); > interp.exec("print a"); > interp.exec("x = 2+2"); > PyObject x = interp.get("x"); > > System.out.println("x: "+x); > System.out.println("Goodbye, cruel world"); > } > } > > class MyClass > { > public void doSomething(){} > } > > > > |
From: Kevin B. <kb...@ca...> - 2002-02-11 15:52:57
|
Yang Wang wrote: > > Hi All, > > I am trying to use os.system("start mine.bat") to start a program in a > separate window. But the problem is that the control remains in the new > window and did not go back to the Jython window at all. Until I exit > the "mine.bat", the prompt in Jython began to show up. From "help start" on NT/4: > When executing an application that is a 32-bit GUI application, CMD.EXE > does not wait for the application to terminate before returning to > the command prompt. This new behavior does NOT occur if executing > within a command script. > Did I use the right command to do this? Yes. Maybe. system() starts a command and waits for it to complete. > I looked at other Python > commands such as os.execl() but when I try it on Jython, it would say > that "AttributeError: class 'org.python.modules.os' has no attribute > 'execl'". RSN I'll implement the os.exec() functions, but I haven't gotten around to it yet. Currently, to have your app continue running after launching the command, you can either: - run the command as java.lang.runtime.getRuntime().exec([ "cmd.exe", "/c", "mine.bat" ]) - run system in a separate thread as thread.start_new_thread( os.system, ("mine.bat",)) Note that either approach may leave your jython application without the focus (depends on what the MS Window Manager decides to do), so you may need to add a "setFocus" command to your jython GUI application. kb |
From: leon j. b. <lj...@ne...> - 2002-02-11 09:27:28
|
On Wed, Feb 06, 2002 at 03:08:55PM +0200, leon j. breedt wrote: > i need to make all the classes in a specific package available > to Jython script code without the code having to qualify the > class names. it seems doing an exec() against the namespace works just as well.. simplest solution best i guess :) -- lj...@ne... :: +27.82.7890445 >> don't play in the kiln. |
From: Oti <oh...@ya...> - 2002-02-10 14:56:26
|
Maybe you try: public class MyClass { public MyClass(){} } HTH, Oti. [ John Young ] > I think the line: > interp.exec("MyObject = MyClass()"); > > is causing the following exception: > > java.lang.IllegalAccessException: Class > org.python.core.PyReflectedConstructor can not access a member of > class > MyClass with modifiers "public" <snipped > > At the moment, MyClass is just: > > class MyClass > { > public MyClass(){} > } > > > (MyClass is defined in SimpleEmbedded.java too) __________________________________________________ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com |
From: Ype K. <yk...@xs...> - 2002-02-10 11:10:22
|
Dirk, >Hello, > >I have noticed a strange behavior of Jython. Coming from CPython I run >into this problem and I'm not sure if it was pure luck that this worked >for me so far, or if jython has a bug. > >Consider the following program: > >class c: > def m(self): > pass > >i = c() > >d = {} > >d[i.m] = 42 >d[i.m] = 23 >print d > >This yields, not very suprising, this result with CPython 2.1.1: >dirk@susi:~/python> python test.py >{<method c.m of c instance at 0x80e6394>: 23} > >With Jython 2.1 and Sun Java2 1.4rc1 however: >dirk@susi:~/python> ../jython-2.1/jython test.py >{<method c.m of c instance at 16348303>: 23, <method c.m of c instance >at 16348303>: 42} > >Well, this caught me rather off-guard and I debug quite a while. I would >be extremely happy I anybody could explain this to me. I'm quite unsure >how Python or Jython compare methods anyway. I think this is a bug in jython: the same method instance can occur multiple times as a key in a dictionary. I'd recommend to file the original message as a bug report on jython.sourceforge.net. Regards, Ype -- |
From: John Y. <wo...@ec...> - 2002-02-10 06:26:29
|
Thanks for that, but.... I think the line: interp.exec("MyObject = MyClass()"); is causing the following exception: java.lang.IllegalAccessException: Class org.python.core.PyReflectedConstructor can not access a member of class MyClass with modifiers "public" at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:57) at java.lang.reflect.Constructor.newInstance(Constructor.java:268) at org.python.core.PyReflectedConstructor.__call__(PyReflectedConstructor.java) at org.python.core.PyJavaInstance.__init__(PyJavaInstance.java) at org.python.core.PyJavaClass.__call__(PyJavaClass.java) at org.python.core.PyObject.__call__(PyObject.java) at org.python.pycode._pyx2.f$0(<string>:1) at org.python.pycode._pyx2.call_function(<string>) at org.python.core.PyTableCode.call(PyTableCode.java) at org.python.core.PyCode.call(PyCode.java) at org.python.core.Py.runCode(Py.java) at org.python.core.Py.exec(Py.java) at org.python.util.PythonInterpreter.exec(PythonInterpreter.java) at SimpleEmbedded.main(SimpleEmbedded.java:19) java.lang.IllegalAccessException: java.lang.IllegalAccessException: Class org.python.core.PyReflectedConstructor can not access a member of class MyClass with modifiers "public" At the moment, MyClass is just: class MyClass { public MyClass(){} } (MyClass is defined in SimpleEmbedded.java too) The exception seems to say that I can't access the constructor because it is public, yet if I take it out... it says it can't find a public constructor. Also, will the following work, if I want a python MyClass object to access the data in a java MyClass object? MyClass AnObject = new MyClass(); interp.exec("import MyClass"); interp.exec("MyObject = MyClass()"); interp.set("MyObject", AnObject); Any suggestions? |
From: Frank C. <fc...@pu...> - 2002-02-10 01:46:00
|
I'm writing a Jython program that repeats an operation over and over again. I'd like to sense for any key on the keyboard being pressed to end the loop. Python (C) on Windows has the msvcrt library which provides some useful MS Visual C functions. Is there such a thing for Jython? -Frank -- Frank Cohen, CEO, PushToTest, www.pushtotest.com, phone: 408 374 7426 Come to PushToTest for free open-source Active Security solutions that test, monitor and automate Web Service systems for functionality, scalability and performance. |
From: <Dir...@t-...> - 2002-02-09 21:45:13
|
Hello, I have noticed a strange behavior of Jython. Coming from CPython I run into this problem and I'm not sure if it was pure luck that this worked for me so far, or if jython has a bug. Consider the following program: class c: def m(self): pass i = c() d = {} d[i.m] = 42 d[i.m] = 23 print d This yields, not very suprising, this result with CPython 2.1.1: dirk@susi:~/python> python test.py {<method c.m of c instance at 0x80e6394>: 23} With Jython 2.1 and Sun Java2 1.4rc1 however: dirk@susi:~/python> ../jython-2.1/jython test.py {<method c.m of c instance at 16348303>: 23, <method c.m of c instance at 16348303>: 42} Well, this caught me rather off-guard and I debug quite a while. I would be extremely happy I anybody could explain this to me. I'm quite unsure how Python or Jython compare methods anyway. Cheers, Dirk |
From: Ype K. <yk...@xs...> - 2002-02-09 08:38:06
|
John, >quick question with embedding jython.... in the following example >(from the embedding 'tutorial' at jython.org) >how do I access MyClass from within the python code? > >import org.python.util.PythonInterpreter; >import org.python.core.*; > >public class SimpleEmbedded { > public static void main(String []args) throws PyException > { > PythonInterpreter interp = new PythonInterpreter(); <snip> > // how do I do this? > // interp.exec("MyObject.doSomething()"); <snip> > } >} >class MyClass >{ > public void doSomething(){} >} > > Try this: interp.exec("from MyPackage import MyClass"); /* or just "import MyClass" */ interp.exec("MyObject = MyClass()"); interp.exec("MyObject.doSomething()"); The first line is obviously dependent on your package and class path. Good luck, Ype -- |
From: John Y. <wo...@ec...> - 2002-02-09 05:36:20
|
quick question with embedding jython.... in the following example (from = the embedding 'tutorial' at jython.org) how do I access MyClass from within the python code? import org.python.util.PythonInterpreter;=20 import org.python.core.*;=20 public class SimpleEmbedded {=20 public static void main(String []args) throws PyException {=20 PythonInterpreter interp =3D new PythonInterpreter(); MyClass = MyObject =3D new MyClass(); // A class created by me System.out.println("Hello, brave new world"); interp.exec("import sys"); interp.exec("print sys"); // how do I do this? // = interp.exec("MyObject.doSomething()"); interp.set("a", new PyInteger(42)); interp.exec("print a"); interp.exec("x =3D 2+2"); PyObject x =3D interp.get("x"); System.out.println("x: "+x); System.out.println("Goodbye, cruel world"); } } class MyClass{ public void doSomething(){}} |
From: O'Brien-Strain, E. <eo...@ex...> - 2002-02-09 01:17:14
|
You could do something like: from java.lang import Runtime runtime = Runtime.getRuntime() runtime.exec("start mine.bat") __ Eamonn O'Brien-Strain HP Labs eo...@hp... > -----Original Message----- > From: Yang Wang [mailto:yw...@pr...] > Sent: Friday, February 08, 2002 4:24 PM > To: jyt...@li... > Subject: [Jython-users] start a Window2K program in a separate window > and back to Jython > > > Hi All, > > I am trying to use os.system("start mine.bat") to start a program in a > separate window. But the problem is that the control remains > in the new > window and did not go back to the Jython window at all. Until I exit > the "mine.bat", the prompt in Jython began to show up. > > Did I use the right command to do this? I looked at other Python > commands such as os.execl() but when I try it on Jython, it would say > that "AttributeError: class 'org.python.modules.os' has no attribute > 'execl'". > > Thanks in advance! > Yang > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |
From: Brian Z. <bri...@ya...> - 2002-02-09 00:48:30
|
http://www.geocrawler.com/archives/3/7017/2001/8/0/6476573/ ----- Original Message ----- From: "Kris Warkentin" <kew...@qn...> To: <jyt...@li...> Sent: Friday, February 08, 2002 7:20 AM Subject: Re: [Jython-dev] jython in IBM's j9 vm > Oops....sorry about that - the only email I had with a 'reply-to' was one of > those spams and I must have not deleted it all...DOH! > Disregard the first sentence - you didn't win anything. > ;-) > > Kris > ----- Original Message ----- > From: "Kris Warkentin" <kew...@qn...> > To: <jyt...@li...> > Sent: Friday, February 08, 2002 10:07 AM > Subject: [Jython-dev] jython in IBM's j9 vm > > > > CONGRATULATIONS!! YOU WON!!I'm running jython on QNX6 in IBM's j9 vm. It > > seems to work fine as a regular python interpreter but I can't get access > to > > java classes. When I do an 'import java' I get a no such module found > > error. What mechanism does jython use to get access to java classes? > Maybe > > there's something missing from the vm. I can do regular imports of things > > like math and such, although some things (like cgi) seem to use java so > they > > fail to import properly. > > > > cheers, > > > > Kris > > > > > > _______________________________________________ > > Jython-dev mailing list > > Jyt...@li... > > https://lists.sourceforge.net/lists/listinfo/jython-dev > > > > > _______________________________________________ > Jython-dev mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-dev > |
From: Yang W. <yw...@pr...> - 2002-02-09 00:23:41
|
Hi All, I am trying to use os.system("start mine.bat") to start a program in a separate window. But the problem is that the control remains in the new window and did not go back to the Jython window at all. Until I exit the "mine.bat", the prompt in Jython began to show up. =20 Did I use the right command to do this? I looked at other Python commands such as os.execl() but when I try it on Jython, it would say that "AttributeError: class 'org.python.modules.os' has no attribute 'execl'". =20 Thanks in advance! Yang |
From: Jeff E. <je...@ad...> - 2002-02-08 19:05:05
|
Thanks for the great analysis. I'll log the bug. Kevin Butler wrote: > Very interesting. > > Looks like a definite bug in the garbage collector or assignment behavior, but I'm not conversant enough w/ the Java VM internals to pursue it further. I moved everything to Java then brought pieces back to Python, and found some interesting things. It only occurs if the assignment is in Python, and only if we allocate a new Jython Instance each time. > Jeff, do you want to/did you enter a bug, or shall I? > > kb |
From: Kevin B. <kb...@ca...> - 2002-02-08 18:58:00
|
Very interesting. Looks like a definite bug in the garbage collector or assignment behavior, but I'm not conversant enough w/ the Java VM internals to pursue it further. I moved everything to Java then brought pieces back to Python, and found some interesting things. It only occurs if the assignment is in Python, and only if we allocate a new Jython Instance each time. Here's my output w/ -verbose:gc [GC 511K->143K(1984K), 0.0063209 secs] [GC 646K->154K(1984K), 0.0057092 secs] [GC 666K->334K(1984K), 0.0076847 secs] [GC 846K->609K(1984K), 0.0089791 secs] [GC 1121K->769K(1984K), 0.0077756 secs] [GC 1349K->972K(1984K), 0.0075615 secs] [GC 1484K->1017K(1984K), 0.0041208 secs] [GC 1529K->1529K(2112K), 0.0108365 secs] [Full GC 1529K->1256K(2112K), 0.1101383 secs] [GC 1768K->1768K(2672K), 0.0089964 secs] [GC 2280K->2280K(2800K), 0.0093338 secs] [Full GC[Unloading class sun.reflect.GeneratedMethodAccessor1] 2280K->2280K(2800K), 0.1113977 secs] [GC 2735K->2735K(4284K), 0.0495713 secs] [GC 3247K->3247K(4284K), 0.0097242 secs] [GC 3759K->3759K(4284K), 0.0100759 secs] [GC 4271K->4271K(4796K), 0.0101293 secs] [Full GC 4271K->4271K(4796K), 0.1363462 secs] [GC 4731K->4731K(7612K), 0.0557635 secs] [GC 5243K->5243K(7612K), 0.0109620 secs] [GC 5755K->5755K(7612K), 0.0101355 secs] [GC 6267K->6267K(7612K), 0.0105186 secs] [GC 6779K->6779K(7612K), 0.0099337 secs] [GC 7291K->7291K(7868K), 0.0099397 secs] [Full GC 7291K->7231K(7868K), 0.2444919 secs] [GC 8127K->8127K(13016K), 0.0159969 secs] [GC 9023K->9023K(13016K), 0.0183957 secs] [GC 9918K->9918K(13016K), 0.0185267 secs] [GC 10814K->10814K(13016K), 0.0156633 secs] [GC 11710K->11710K(13016K), 0.0180231 secs] [GC 12606K->12606K(13528K), 0.0179447 secs] [Full GC 12606K->12606K(13528K), 0.2222574 secs] [GC 14103K->14103K(22612K), 0.1005230 secs] [GC 15639K->15639K(22612K), 0.0282855 secs] [GC 17175K->17175K(22612K), 0.0373953 secs] [GC 18711K->18711K(22612K), 0.0282713 secs] [GC 20247K->20247K(22612K), 0.0307812 secs] [GC 21783K->21783K(23380K), 0.0296263 secs] [Full GC 21783K->21783K(23380K), 0.3246291 secs] [GC 24275K->24275K(39012K), 0.1485914 secs] [GC 26835K->26835K(39012K), 0.0468365 secs] 256 512 768 1024 1280 1536 1792 2048 2304 2560 2816 3072 3328 3584 3840 4096 4352 4608 4864 5120 5376 5632 5888 6144 6400 6656 6912 7168 7424 7680 7936 8192 8448 8704 8960 9216 9472 9728 9984 10240 10496 10752 [GC 29395K->28034K(39012K), 0.0413931 secs] 11008 11264 11520 11776 12032 12288 12544 12800 13056 13312 13568 13824 14080 14336 14592 14848 15104 15360 15616 15872 16128 16384 16640 16896 17152 17408 17664 17920 18176 18432 18688 18944 19200 19456 19712 19968 20224 20480 20736 20992 21248 21504 21760 22016 22272 22528 22784 23040 23296 23552 23808 24064 24320 24576 24832 25088 25344 25600 25856 26112 26368 26624 26880 27136 27392 27648 27904 28160 28416 28672 28928 29184 29440 29696 [GC Yes, the protection fault occurred just after writing '[GC' Here's the code (Crash.java): import org.python.util.PythonInterpreter; import org.python.core.*; import java.util.*; public class Crash { public Object data; public Crash(int n) { data=new byte[n]; } static PythonInterpreter cInterp = new PythonInterpreter(); static PyCode cCode = __builtin__.compile( "obj.data = newvalue", "<string>", "exec" ); static { cInterp.set( "newvalue", new Object() ); } // only crashes if DO_EACH and DO_PYTHON are both true static boolean DO_EACH = true; static boolean DO_PYTHON = true; public static void replace( Object o ) { cInterp.set( "obj", o ); if ( DO_EACH ) { cInterp.set( "newvalue", new Object() ); } if ( DO_PYTHON ) { cInterp.exec( cCode ); } else { ((Crash)o).data = new PyJavaInstance( new Object() ); } } public static void iterate( Collection c ) { Iterator i = c.iterator(); int n =0; while (i.hasNext()) { if ( (++n & 255) == 0 ) System.out.print( n + " " ); replace( i.next() ); } } public static Collection makeCollection( int n, int m ) { Collection c = new LinkedList(); for ( int i = 0; i < n; i++ ) { c.add( new Crash( m )); } return c; } public static void crash( int n, int m ) { iterate( makeCollection( n, m )); } public static void main(String []args) { int n = Integer.getInteger( "n", 100000 ).intValue(); int m = Integer.getInteger( "m", 222 ).intValue(); crash( n, m ); } } And here's the makefile: JDK=f:/j2sdk1.4 JAVAC=${JDK}/bin/javac JAVA=${JDK}/bin/java JYTHON=w:\tools\jython\jython.jar test2: Crash.class ${JAVA} -verbose:gc -classpath '${JYTHON};${CLASSPATH}' Crash Jeff, do you want to/did you enter a bug, or shall I? kb Jeff Emanuel wrote: > > Ok, here are the files inline: > > crash.py: > import java, Crash > > def makeContainer(n,m): > c=java.util.LinkedList() > for i in range(n): > c.add(Crash(m)) > return c > > def crash(it): > while it.hasNext(): > node = it.next() > node.data = java.lang.Object() > > if __name__=="__main__": > n=100000 > m=222 > container=makeContainer(n,m) > crash(container.iterator()) > > Crash.java: > public class Crash { > public Object data; > public Crash(int n) { > data=new byte[n]; > } > } > > Thanks for your interest. |
From: Jeff E. <je...@ad...> - 2002-02-08 16:46:05
|
Ok, here are the files inline: crash.py: import java, Crash def makeContainer(n,m): c=java.util.LinkedList() for i in range(n): c.add(Crash(m)) return c def crash(it): while it.hasNext(): node = it.next() node.data = java.lang.Object() if __name__=="__main__": n=100000 m=222 container=makeContainer(n,m) crash(container.iterator()) Crash.java: public class Crash { public Object data; public Crash(int n) { data=new byte[n]; } } Thanks for your interest. |
From: Jan W. <j.w...@sc...> - 2002-02-08 16:21:19
|
On Fri, Feb 08, 2002 at 09:03:40AM -0700, Jeff Emanuel wrote: [...] > [Filename: crash.py, Content-Type: text/plain] > The attachment file in the message has been removed by eManager. > [Filename: Crash.java, Content-Type: text/plain] > The attachment file in the message has been removed by eManager. Hm, somebody didnt like your attachment? Perhaps the filename? Cheerio, --=20 J.W...@sc... - Fon +4970719457-257 Fax-211 science+computing ag - Hagellocher Weg 71-75 - 72070 T=FCbingen Lisp is truly amazing. Anything that's cool in any language existed in L= isp before, and probably is still more usable in Lisp. (W. Tanksley in c.l.py= thon) |