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: cindy <inf...@pi...> - 2001-03-21 15:21:40
|
Hi, I'm a little confude as to how to install jython. I pulled down the tar-ball and untared it. Do I need to use ListOff to install it? From what I read of ListOff, it sounded like I use this product to bundle my classes. I'm using Blackdown distro of java 1.3.0. My current release of python is 1.5.2. The CLASSPATH is set to '/usr/local/jdk1.3/j2sdk1.3.0/bin. I installed jython in /usr/local/jython-20010320. I went to the demo directory to execute some of the modules and had no luck. To execute the demo module simple.py do I enter 'jython simple.py' or 'java simple.py? TIA. Wayne |
From: <bc...@wo...> - 2001-03-21 10:46:38
|
[mike] >I am running into a problem trying to subclass a java class from >Jython2.0. The problem lies in the fact that the java class I extend from >uses reflection to implement the template method pattern. The methods it is >looking for is implemented in my jython class. Here is an example using the >JUnit framework which illustrates my problem: > >---- example.py ---- >import java >import junit > >class MyJavaClassTest(junit.framework.TestCase): > > def __init__(self, name): > junit.framework.TestCase.__init__(self, name) > > def setUp(self): > "@sig public void setUp()" > pass > > def testMyJavaClass(self): > "@sig public void testMyJavaClass()" > pass > >junit.textui.TestRunner.run(MyJavaClassTest("testMyJavaClass")) >---- end example.py ---- > >Running this from the command line I get: > >$ cmd /c c:/devel/jython-2.1/jython.bat example.py >.F >Time: 0 >There was 1 failure: >1) testMyJavaClass(org.python.proxies.__main__$MyJavaClassTest$1) "Method "testM >yJavaClass" not found" > >FAILURES!!! >Tests run: 1, Failures: 1, Errors: 0 > >As you can see the JUnit TestCase class is using reflection to look for the >testMyJavaClass method. Will this example only work if I run jythonc? Yes. >It >looks like the autogenerated proxy class is ignoring the "@sig" >information. Correct. This is unlikely to change. >Also, with the upcoming 2.1 release, will function attributes be used to >replace the "@sig" syntax? No. You will have to override the runTest() method in order to subclass TestCase: import java, junit class MyJavaClassTest(junit.framework.TestCase): def __init__(self, name): junit.framework.TestCase.__init__(self, name) def setUp(self): pass def runTest(self): self.testMyJavaClass() def testMyJavaClass(self): print "testing" junit.textui.TestRunner.run(MyJavaClassTest("someName")) regards, finn |
From: Jim A. <ji...@tr...> - 2001-03-21 07:31:09
|
Mark Ackerman wrote: > > I'm just starting to use jython as a glue language in a java program > (middleware research), and I'm a bit lost. I can successfully call any > method in a standard java class (eg, java.io), but I can't figure out how to > call my own classes and methods. What's the magic I need? > > Mark This works for me: First import your classes: from dsi.fs import FillFiller, Segment Then call a static method: cmdResult = FillFiller.FillSegments( ... ) # Finds the matching static method or just use a class defined in Java: s = Segment( ... ) # This calls the Java constructor with matching parameters. It's really toooo easy ! What problems are you having ? -- __o Jim Adrig _ \<,_ ji...@tr... ' `/ ' ` ___________ `-' `-' |
From: Mark A. <ack...@go...> - 2001-03-21 07:20:32
|
I'm just starting to use jython as a glue language in a java program (middleware research), and I'm a bit lost. I can successfully call any method in a standard java class (eg, java.io), but I can't figure out how to call my own classes and methods. What's the magic I need? Mark |
From: <mi...@hi...> - 2001-03-21 02:07:44
|
I am running into a problem trying to subclass a java class from Jython2.0. The problem lies in the fact that the java class I extend from uses reflection to implement the template method pattern. The methods it is looking for is implemented in my jython class. Here is an example using the JUnit framework which illustrates my problem: ---- example.py ---- import java import junit class MyJavaClassTest(junit.framework.TestCase): def __init__(self, name): junit.framework.TestCase.__init__(self, name) def setUp(self): "@sig public void setUp()" pass def testMyJavaClass(self): "@sig public void testMyJavaClass()" pass junit.textui.TestRunner.run(MyJavaClassTest("testMyJavaClass")) ---- end example.py ---- Running this from the command line I get: $ cmd /c c:/devel/jython-2.1/jython.bat example.py .F Time: 0 There was 1 failure: 1) testMyJavaClass(org.python.proxies.__main__$MyJavaClassTest$1) "Method "testM yJavaClass" not found" FAILURES!!! Tests run: 1, Failures: 1, Errors: 0 As you can see the JUnit TestCase class is using reflection to look for the testMyJavaClass method. Will this example only work if I run jythonc? It looks like the autogenerated proxy class is ignoring the "@sig" information. Also, with the upcoming 2.1 release, will function attributes be used to replace the "@sig" syntax? --mike |
From: Jim A. <ji...@tr...> - 2001-03-20 18:26:00
|
Finn Bock wrote: > The code in a PyTableCode is implemented by a > dynamicly created java class and we do not keep the original java > bytecode around. Even if we kept and saved the java bytecode, loading a > page would still have to recreate a java class for each PyCode. Thanks, now I see why that approach was so slow... > It pains me a lot to say it, but this is one situation where jython's > compile-to-bytecode approach fails to deliver high performance. > > Depending on the design of your forms, if you could collect all the > expressions found on a page into one jython source string: > > """ > def func001(): > return Customer.Name > def func002(): > for p in Customer.Phones: > print p > """ > > then the slow class creation would only occur once for the page. > > PyCode code = __builtin__.compile(pagesrc, "<string>", "exec"); > PyStringMap dict = new PyStringMap() > Py.exec(code, dict, dict) > > and the evaluation of each expression would run at full jython speed: > > PyObject result = dict.__getitem__("func001").__call__(); This is very interesting, I had not considered that approach, since I did not clearly understand where the slowdown was (creating classes). I probably could have had something running by now had I thought of it... But in the meantime, I have been working on a different (more work!) approach where I build jython source for the entire page, with 'callbacks' to Java routines that do extra work: pagePCL = "" errorList = [] ... cmdResult = Customer.Total // User's original expression cmdResult = FillFiller.FormatResults(cmdResult,'#,##0.00') cmdResult = FillFiller.FillSegments(cmdResult, ((525,2322,478)),false,10,'',error) errorList.append(error) pagePCL += cmdResult ... This approach requires more restructuring of my code so I have not been able to benchmark it yet: I'm still working on all the 'callbacks'. Some of them could be rewritten in Python too but I'm not sure that would buy me anything. Then I was going to build a 'cache' (HashMap) of the code-objects for the forms in a servlet so I can just keep the compiled pages in memory (I got this idea while checking out 'Python Server Pages': http://www.ciobriefings.com/psp/ ). There will be hundreds, and eventually maybe thousands, of forms being run so I'm hoping this will be OK: a JDOM tree is cached along with an array of pages (although I may be able to get rid of that with more custom structures later...). Later, with some more restructuring/rewriting I might be able to build complete Python forms and compile them to Java classes (and dynamically load them?), this would save the initial compile (but not much more?). Thanks again for your reply; do you see any problems with my new approach ? -- __o Jim Adrig _ \<,_ ji...@tr... ' `/ ' ` ___________ `-' `-' |
From: Stephen R. F. <fi...@mo...> - 2001-03-20 18:00:52
|
Do you think a program in Jython would be able to run on leJos, the JavaVM for Lego Mindstorms robots? http://lejos.sourceforge.net/ If I had Mindstorms I would give it a try. Has anyone out there tried this? How about running Jython programs on the KVM? J2ME? Any, Jython on small platform stories out there? Stephen |
From: <bc...@wo...> - 2001-03-20 16:59:10
|
On Mon, 19 Mar 2001 10:40:40 -0800, you wrote: >Question: > >How do I comvert a compiled code object to some kind of bytestream? >'Pickle' can't handle PyCode ("can't pickle ...PyTableCode object"), and >PyCode is not serializable. Am I missing something or is there no way to >do this easily? There is no way. Sorry. The code in a PyTableCode is implemented by a dynamicly created java class and we do not keep the original java bytecode around. Even if we kept and saved the java bytecode, loading a page would still have to recreate a java class for each PyCode. >Backround: > >I am prototyping a program that uses Jython to allow users to design >forms by entering Jython expressions which are evaluated based on a >large set of XML data that is 'scoped' into the PythonInterpreter >beforehand. (Example: 'Customer.Name' or 'for p in Customer.Phones: >print p') We have built a GUI that displays the forms and allows entry >of the expressions, the 'definition' of the form is stored in XML along >with Fonts, justification, and other formatting info. After each >expression is evaluated the result is 'massaged' using various Java >routines to build a complete page. > >The previous version used JavaScript (Rhino) but I'm trying to switch it >to Python to make it easier for the form designers. > >I'm having a problem, though, with the speed: when interpreting >expressions Jython is half the speed of Rhino: this is critical for this >app. > >I timed the compile compared the the 'eval' and found the compile takes >90% of the time: > > PyCode code = __builtin__.compile(evalLine, "<string>", "eval"); // >90% > > PyObject result = python.eval( (PyCode)code ); // >10% !! > >If I could store the compiled 'code objects' within the forms somehow I >think I could increase the speed of the forms 10x, but I can't figure >out a way to get some kind of 'bytestream' of the code object. It pains me a lot to say it, but this is one situation where jython's compile-to-bytecode approach fails to deliver high performance. Depending on the design of your forms, if you could collect all the expressions found on a page into one jython source string: """ def func001(): return Customer.Name def func002(): for p in Customer.Phones: print p """ then the slow class creation would only occur once for the page. PyCode code = __builtin__.compile(pagesrc, "<string>", "exec"); PyStringMap dict = new PyStringMap() Py.exec(code, dict, dict) and the evaluation of each expression would run at full jython speed: PyObject result = dict.__getitem__("func001").__call__(); I hope this helps a little. regards, finn |
From: John E. C. <jc...@ve...> - 2001-03-20 05:24:40
|
Brian, I simply forgot about the exec method. And as the article you referred to points out - it is an easy API to misuse. =20 thanks for the excellent advice, example and article,=20 John At 05:06 PM 3/19/01 -0600, Brian Zimmer wrote:=20 > > Here's an interesting article pertaining to Runtime/Process: > =A0 > > <http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html>http://w > ww.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html > =A0 > brian >> >> -----Original Message-----=20 >> From: jyt...@li... >> [mailto:jyt...@li...]On Behalf Of Brian= Zimmer=20 >> Sent: Monday, March 19, 2001 4:42 PM=20 >> To: John E. Conlon; jyt...@li...=20 >> Subject: RE: [Jython-users] How to call external commands >> >> Here's an extremely simple example (by no means production, but could get >> you on your way):=20 >> >> """ =20 >> =A0Process the command. =20 >> """=20 >> >> from java.lang import Runtime =20 >> from java.io import BufferedInputStream=20 >> >> p =3D Runtime.getRuntime().exec("ls") =20 >> #p.waitFor() =20 >> stream =3D BufferedInputStream(p.getInputStream())=20 >> >> e =3D []=20 >> >> r =3D stream.read() =20 >> while r !=3D -1: =20 >> =A0e.append(r) =20 >> =A0r =3D stream.read()=20 >> >> print "".join(map(chr, e))=20 >> >> Running it produces:=20 >> >> D:\home\development\python>jython process.py =20 >> HTTPSession$py.class =20 >> HTTPSession.py =20 >> __init__.py =20 >> a5.py =20 >> aar.py =20 >> acl.py =20 >> aioobe.py =20 >> ant.py =20 >> atl.py =20 >> caps.py =20 >> cont.py=20 >> >> brian=20 >> >> -----Original Message----- =20 >> From: jyt...@li... =20 >> >> [<mailto:jyt...@li...>mailto:jython-users-adm >> in...@li...]On Behalf Of John E. =20 >> Conlon =20 >> Sent: Monday, March 19, 2001 4:22 PM =20 >> To: jyt...@li... =20 >> Subject: [Jython-users] How to call external commands=20 >> >> Hi Jython users,=20 >> >> I would like to replace my bat and sh startup scripts with jython py =20 >> scripts.=A0 But after experimentation I can not figure out how to call = =20 >> external executables in my underlying system.=A0 =20 >> Have seen comments that the os.system(name) command is not yet implemented. =20 >> =A0Is there any other way to launch external programs without the= os.system =20 >> command?=20 >> >> thanks for any suggestions,=20 >> >> John=20 >> >> _______________________________________________ =20 >> Jython-users mailing list =20 >> Jyt...@li... =20 >> >> <http://lists.sourceforge.net/lists/listinfo/jython-users>http://lists.so >> urceforge.net/lists/listinfo/jython-users=20 > ************************************************************************ John E. Conlon jc...@ve... tel: (770) 886-5470 fax: (770) 888-6894 <http://www.verticon.com/>www.verticon.com ************************************************************************ |
From: D-Man <ds...@ri...> - 2001-03-20 01:51:58
|
On Mon, Mar 19, 2001 at 10:03:17PM +0200, Kexx wrote: | | I've given up trying to make Idle (from Python) work with Jython (no | TkInter module). | | I can edit the files using it, of course, but I would like to debug in | GUI mode, and do the rest of the wonderful things the IDE supports. | | Any alternatives I should consider? | | I use JDK 1.3 on Win2k, without "X Window System", so DDD frontends | won't work, I guess... XFree86 is supposed to work on windows. I didn't try very hard, but I did get the background to appear. If you can get XFree working then you can use DDD. You could also try Vide (www.objectcentral.com/vide.htm) or NetBeans (www.netbeans.org). They are Java debuggers (ides) and can therefore debug the java the interpreter is implemented in, but probably won't be able to handle the python source very well. I have used NetBeans only a little, and it seems rather nice. I haven't tried Vide yet. When I was using a Unix system I thought that DDD was really good, except I don't really like it's choice of toolkits. Alternatively, print works on all systems ;-). | P.S. I would appreciate replys to [1]ke...@in... if at all possible | (sourceforge mailinglists confuse me). You simply subscribe to the mailing list. Then whenever someone (like me replying to your message) sends a message to the list's address, you get a copy sent to you. Are you subscribed to the list? -D |
From: Joseph S. B. I. <jo...@ba...> - 2001-03-20 01:41:37
|
Brian Zimmer a =E9crit: > Here's an extremely simple example (by no means production, but could= > get you on your way): Here's what I've been using. For outwriter and errwriter, one can pass either PrintStreams, OutputStreamWriters, or (if you don't care about the output) None. execvbuf =3D zeros(8192, "c") def execv(name, outwriter, errwriter): # I don't know why we need to check for PrintStream, # given that instanceof(PrintStream, OutputStream)... # or maybe I need a mix of isinstance() and issubclass()... # if isinstance(outwriter, OutputStream) or isinstance(outwriter, Pri= ntStream): outwriter =3D OutputStreamWriter(outwriter) if isinstance(errwriter, OutputStream) or isinstance(errwriter, Pri= ntStream): errwriter =3D OutputStreamWriter(errwriter) process =3D getRuntime().exec(name) stdout =3D InputStreamReader(process.getInputStream()) stderr =3D InputStreamReader(process.getErrorStream()) while 1: if stdout <> None: if stdout.ready(): n =3D stdout.read(execvbuf) if n =3D=3D -1: stdout =3D None print "stdout now None" continue if outwriter <> None: outwriter.write(execvbuf, 0, n) continue if stderr <> None: if stderr.ready(): n =3D stderr.read(execvbuf) if n =3D=3D -1: stderr =3D None print "stderr now None" continue if errwriter <> None: errwriter.write(execvbuf, 0, n) continue try: status =3D process.exitValue() if status <> 0: print "%s returned status %d" % (name, status) return status except: sleep(200) |
From: D-Man <ds...@ri...> - 2001-03-20 01:34:34
|
On Mon, Mar 19, 2001 at 05:21:58PM -0500, John E. Conlon wrote: | Hi Jython users, | | I would like to replace my bat and sh startup scripts with jython py | scripts. But after experimentation I can not figure out how to call | external executables in my underlying system. Why not use CPython for this? Do need access to java classes in these startup scripts? -D |
From: Brian Z. <bz...@ig...> - 2001-03-19 23:04:12
|
Here's an interesting article pertaining to Runtime/Process: =20 http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html <http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html>=20 =20 brian -----Original Message----- From: jyt...@li... [mailto:jyt...@li...]On Behalf Of Brian Zimmer Sent: Monday, March 19, 2001 4:42 PM To: John E. Conlon; jyt...@li... Subject: RE: [Jython-users] How to call external commands Here's an extremely simple example (by no means production, but could get you on your way):=20 """=20 Process the command.=20 """=20 from java.lang import Runtime=20 from java.io import BufferedInputStream=20 p =3D Runtime.getRuntime().exec("ls")=20 #p.waitFor()=20 stream =3D BufferedInputStream(p.getInputStream())=20 e =3D []=20 r =3D stream.read()=20 while r !=3D -1:=20 e.append(r)=20 r =3D stream.read()=20 print "".join(map(chr, e))=20 Running it produces:=20 D:\home\development\python>jython process.py=20 HTTPSession$py.class=20 HTTPSession.py=20 __init__.py=20 a5.py=20 aar.py=20 acl.py=20 aioobe.py=20 ant.py=20 atl.py=20 caps.py=20 cont.py=20 brian=20 -----Original Message-----=20 From: jyt...@li...=20 [ mailto:jyt...@li... <mailto:jyt...@li...> ]On Behalf Of John E.=20 Conlon=20 Sent: Monday, March 19, 2001 4:22 PM=20 To: jyt...@li...=20 Subject: [Jython-users] How to call external commands=20 Hi Jython users,=20 I would like to replace my bat and sh startup scripts with jython py=20 scripts. But after experimentation I can not figure out how to call=20 external executables in my underlying system. =20 Have seen comments that the os.system(name) command is not yet implemented.=20 Is there any other way to launch external programs without the os.system=20 command?=20 thanks for any suggestions,=20 John=20 _______________________________________________=20 Jython-users mailing list=20 Jyt...@li...=20 http://lists.sourceforge.net/lists/listinfo/jython-users <http://lists.sourceforge.net/lists/listinfo/jython-users> =20 |
From: Brian Z. <bz...@ig...> - 2001-03-19 22:39:36
|
Here's an extremely simple example (by no means production, but could get you on your way): """ Process the command. """ from java.lang import Runtime from java.io import BufferedInputStream p =3D Runtime.getRuntime().exec("ls") #p.waitFor() stream =3D BufferedInputStream(p.getInputStream()) e =3D [] r =3D stream.read() while r !=3D -1: e.append(r) r =3D stream.read() print "".join(map(chr, e)) Running it produces: D:\home\development\python>jython process.py HTTPSession$py.class HTTPSession.py __init__.py a5.py aar.py acl.py aioobe.py ant.py atl.py caps.py cont.py brian -----Original Message----- From: jyt...@li... [mailto:jyt...@li...]On Behalf Of John E. Conlon Sent: Monday, March 19, 2001 4:22 PM To: jyt...@li... Subject: [Jython-users] How to call external commands Hi Jython users, I would like to replace my bat and sh startup scripts with jython py scripts. But after experimentation I can not figure out how to call external executables in my underlying system. =20 Have seen comments that the os.system(name) command is not yet implemented. Is there any other way to launch external programs without the os.system command? thanks for any suggestions, John _______________________________________________ Jython-users mailing list Jyt...@li... http://lists.sourceforge.net/lists/listinfo/jython-users |
From: John E. C. <jc...@ve...> - 2001-03-19 22:14:34
|
Hi Jython users, I would like to replace my bat and sh startup scripts with jython py scripts. But after experimentation I can not figure out how to call external executables in my underlying system. Have seen comments that the os.system(name) command is not yet implemented. Is there any other way to launch external programs without the os.system command? thanks for any suggestions, John |
From: Kexx <ke...@in...> - 2001-03-19 20:05:11
|
I've given up trying to make Idle (from Python) work with Jython (no = TkInter module). I can edit the files using it, of course, but I would like to debug in = GUI mode, and do the rest of the wonderful things the IDE supports. Any alternatives I should consider? I use JDK 1.3 on Win2k, without "X Window System", so DDD frontends = won't work, I guess... Should I bear with pdb? Best regards, Juris. P.S. I would appreciate replys to ke...@in... if at all possible = (sourceforge mailinglists confuse me). |
From: Jim A. <ji...@tr...> - 2001-03-19 18:38:30
|
Question: How do I comvert a compiled code object to some kind of bytestream? 'Pickle' can't handle PyCode ("can't pickle ...PyTableCode object"), and PyCode is not serializable. Am I missing something or is there no way to do this easily? Backround: I am prototyping a program that uses Jython to allow users to design forms by entering Jython expressions which are evaluated based on a large set of XML data that is 'scoped' into the PythonInterpreter beforehand. (Example: 'Customer.Name' or 'for p in Customer.Phones: print p') We have built a GUI that displays the forms and allows entry of the expressions, the 'definition' of the form is stored in XML along with Fonts, justification, and other formatting info. After each expression is evaluated the result is 'massaged' using various Java routines to build a complete page. The previous version used JavaScript (Rhino) but I'm trying to switch it to Python to make it easier for the form designers. I'm having a problem, though, with the speed: when interpreting expressions Jython is half the speed of Rhino: this is critical for this app. I timed the compile compared the the 'eval' and found the compile takes 90% of the time: PyCode code = __builtin__.compile(evalLine, "<string>", "eval"); // 90% PyObject result = python.eval( (PyCode)code ); // 10% !! If I could store the compiled 'code objects' within the forms somehow I think I could increase the speed of the forms 10x, but I can't figure out a way to get some kind of 'bytestream' of the code object. -- __o Jim Adrig _ \<,_ ji...@tr... ' `/ ' ` ___________ `-' `-' Flon's Law: There is not now, and never will be, a language in which it is the least bit difficult to write bad programs. |
From: Robert W. B. <rb...@di...> - 2001-03-19 00:12:51
|
Hi, um... Uncle Roastie (Ron), [Uncle Roastie] > In my reading on JPython/Jython, I came across a comment > that said many of the Python Library modules are not included > in the Jython distribtion for installation. It then says that you > can easily download these missing modules yourself from > the Jython home page. So I started looking for the missing modules, > but was unsuccessful in my search. The JPython distribution used to be released without the libs, and the libs could be downloaded separately on the JPython site- that could be what the comment referred to. Also, as Jython's Lib directory was growing, it was suggested that getting the libs from CPython to "try and see what worked" was a good idea. CPython's libs are in my Jython path, so maybe the reference was to the CPython modules (www.python.org). In other words, there isn't really extra libraries to be downloaded from the Jython site at this time. For libraries not included with Jython, look to the CPython module library (if the module itself is not written in C that is). Regards, Robert |
From: Uncle R. <ro...@ro...> - 2001-03-18 21:43:05
|
I'm trying to have my Java code execute existing Jython code. When I compile the code using javac, I get a compiler = error that says it doesn't recognize the class PythonInterpreter (see = <=3D=3D=3D). CLASSPATH: has the JDK, the jython.jar, my Jython application jar PATH: has the JVM import org.python.util.PythonInterpreter; import org.python.core.*; import SomeJavaClass; public class MyJavaClass { public void SomeMethod (void) { PythonInterpreter interp =3D new PythonInterpreter(); // = <=3D=3D=3D=3D=3D=3D=3D=3D compiler error SomeJavaClass javaVar =3D null; // java statements, handled in Python interp.exec("import MyJythonModule"); =20 interp.exec("javaVar =3D MyJythonModule.someMethod()"); javaVar =3D (SomeJavaClass)interp.get("javaVar", = SomeJavaClass); } // end SomeMethod } // end class MyJavaClass Any ideas would be appreciated. Ron ron...@ne... (W) ro...@ro... (H) |
From: Uncle R. <ro...@ro...> - 2001-03-18 20:01:27
|
In my reading on JPython/Jython, I came across a comment that said many of the Python Library modules are not included in the Jython distribtion for installation. It then says that you can easily download these missing modules yourself from the Jython home page. So I started looking for the missing modules,=20 but was unsuccessful in my search. Any hints/pointers would be appreciated. Ron ron...@ne... (W) ro...@ro... (H) |
From: <bc...@wo...> - 2001-03-17 18:37:38
|
[Moved to jython-users] [John A. Tenney] >We have developed a machine controller written in Java (with real-time >portions in C++), and are looking for a good language that allows scripting >our application. We have found Jython to be great for this, in general, but >have some performance concerns. Currently, we call >"InterativeConsole.push(String)" to download our code (including functions), >line by line to the Jython environment. That's strange. And by strange, I don't mean the performance problem you are seing, but your use of the interpreter <wink>. The push() method is only intended for interactive use where the user are actually typing each line. If you already have your entire script, the PythonInterpreter.exec() and PythonInterpreter.execfile() are much faster. >Then we can invoke the functions >just by calling the function name. When I load a Jython function, does it >get interpreted to some intermediate form that executes faster, or is every >line always parsed every time it is executed? Each call to push() will attempt to compile the entire script. Many times the compilation will fail because the script isn't complete yet. The exec and execfile methods will compile the string/file only once. An example: --------------- si4.java --------------- import java.util.*; import org.python.core.*; import org.python.util.*; public class si4 { public static void main(String[] args) { PythonInterpreter interp = new PythonInterpreter(); interp.execfile("si4.py"); interp.exec("foo(42)"); interp.get("foo").__call__(new PyString("hello world")); } } --------------- si4.py --------------- def foo(value): print "now in foo. Value is", value The java program loads the script "si4.py" and all the module symbols that the script defines will be available in the PythonInterpreter namespace. Then the "foo" function is called twice. The first call uses exec which is the simplest to use but it is also the slowest. The second call to "foo" uses an explicit lookup and call and is a lot faster. >Also, we find that our functions can have no full line comments; if they do, >when we push the comment line, it interprets it as an "end of function". An artifact of using push(). >Is there any list that we can subscribe to for Jython users? The jython-users list: http://lists.sourceforge.net/lists/listinfo/jython-users regards, finn |
From: D-Man <ds...@ri...> - 2001-03-16 16:25:57
|
On Thu, Mar 15, 2001 at 10:00:18AM +0100, Georg Umgiesser wrote: | | Hallo, | | I like the idea of using Jython in parallel with Python. However, | I did not find any message in the Jython homepage on GUI's. | What GUI's are supported? Is Tkinter supported? To support Tkinter, you would need access to compiled C code. I think CPython does this by calling into the tcl interpreter to execute the Tk code (but I'm not 100% sure). Jython only has access to Java stuff, unless you use JNI to give Java access to C stuff. You could make Tkinter (or any other toolkit like PyGTK or wxPython) accessible, but it would be a pain and require JNI. Actually, if you like GTK, there are already Java bindings, and Jython connects Python to Java very seamlessly. Of course, that would require having GTK on the system, which means dealing with C binaries. One of the nice features of Python and Java is system independce, except for the interpreter itself. -D |
From: Daniel L. <da...@br...> - 2001-03-16 05:14:41
|
Georg, AWT and Swing (Java GUI) are supported very well. Use those. The advantage is that you can use a free Java IDe to design your GUI and then import (i.e. cut and paste in the Jython source--Tkinter eat your heart out wishing for a graphical designer ;-) I use free ones try JBuilder, Net Beans, or Sun--all offer reasonably complete IDes in free versions. Good luck. Daniel Lord da...@br... |
From: Tom B. <bra...@db...> - 2001-03-15 21:09:22
|
For anyone who cares, I've written a quick and dirty class that allows Python scripting (via Jython) within the dbXML server. This module is not officially supported by the dbXML Group, but may be in the future. I'm spread rather thin lately, so if anyone wants to pick up the development of this piece, I'd appreciate it. You can find the Python module at http://www.tbradford.org/ More info for dbXML can be found at http://www.dbxml.org/ Thanks, Tom |
From: Ype K. <yk...@xs...> - 2001-03-15 19:17:16
|
Already sent to syKim: > > >syKim, > >>Thank you very much, Ype :) >> >>I saw your code and it was very helpful.. >> >>Now, I'm got the idea of translation DnD in Java >> >>I'll try more translation for it.. Thank you. > >My pleasure. > >>However, According to your mention as below: >>>Since you have some Java code already, you can subclass it >>>in Jython (Just as JTree is subclassed here), so >>>there is no need to rewrite existing Java code into Jython. >> >>It's possible that import .java source file? >> >>I thought that only .py can be imported... >> >>How import .java source file? just import as impoting .py or other way on >>it? > >Compile the .java file to a .class file, and make sure the directory >of the class file is part of the java class path when you invoke >jython. Then have a look at: > >http://www.jython.org/docs/usejava.html > >and enjoy the miracles of dynamic method invocation, class >attribute access and subclassing in jython. > >Have fun, >Ype |