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: Brad C. <bk...@mu...> - 2001-01-10 15:47:37
|
For some reason the @sig line in the code below doesn't work. The resulting .java file doesn't have a public Put() method.. I added java.lang to the String type to see if that would fix it.. no go (the web docs say that all types *except* those in java.lang need to be fully specified, yet the example on the web page does have java.lang.String spelled out). Does anyone have any ideas? -- Python Code -- # FTPClient from ftplib import FTP class FTPClient: def __init__(self): pass def Put(self,host,user,passwd,fileName,filePath): "@sig public void Put(java.lang.String host, java.lang.String user, java.lang.String passwd, java.lang.String fileName, java.lang.String filePath)" ftp = FTP(host,user,passwd) file = open(filePath,"rb"); ftp.storbinary("stor "+fileName,file,512) ftp.quit() --- Resulting Java Class package tinitools; import org.python.core.*; public class FTPClient extends java.lang.Object { static String[] jpy$properties = new String[] {"python.modules.builtin", "exceptions:org.python.core.exceptions", "python.options.showJavaExceptions", "true"}; static String[] jpy$packages = new String[] {"org.python.core", null, "java.lang", null, "java.io", null, "java.net", null}; public static class _PyInner extends PyFunctionTable implements PyRunnable { private static PyObject s$0; private static PyObject s$1; private static PyObject s$2; private static PyObject s$3; private static PyObject i$4; private static PyFunctionTable funcTable; private static PyCode c$0___init__; private static PyCode c$1_Put; private static PyCode c$2_FTPClient; private static PyCode c$3_main; private static void initConstants() { s$0 = Py.newString("E:\\prj\\src\\jbuilder\\tini\\python\\FTPClient.py"); s$1 = Py.newString("@sig public void Put(java.lang.String host, java.lang.String user, java.lang.String passwd, java.lang.String fileName, java.lang.String filePath)"); s$2 = Py.newString("rb"); s$3 = Py.newString("stor "); i$4 = Py.newInteger(512); funcTable = new _PyInner(); c$0___init__ = Py.newCode(1, new String[] {"self"}, "E:\\prj\\src\\jbuilder\\tini\\python\\FTPClient.py", "__init__", false, false, funcTable, 0); c$1_Put = Py.newCode(6, new String[] {"self", "host", "user", "passwd", "fileName", "filePath", "ftp", "file"}, "E:\\prj\\src\\jbuilder\\tini\\python\\FTPClient.py", "Put", false, false, funcTable, 1); c$2_FTPClient = Py.newCode(0, new String[] {"__init__", "Put"}, "E:\\prj\\src\\jbuilder\\tini\\python\\FTPClient.py", "FTPClient", false, false, funcTable, 2); c$3_main = Py.newCode(0, new String[] {}, "E:\\prj\\src\\jbuilder\\tini\\python\\FTPClient.py", "main", false, false, funcTable, 3); } public PyCode getMain() { if (c$3_main == null) _PyInner.initConstants(); return c$3_main; } public PyObject call_function(int index, PyFrame frame) { switch (index){ case 0: return _PyInner.__init__$1(frame); case 1: return _PyInner.Put$2(frame); case 2: return _PyInner.FTPClient$3(frame); case 3: return _PyInner.main$4(frame); default: return null; } } private static PyObject __init__$1(PyFrame frame) { // pass return Py.None; } private static PyObject Put$2(PyFrame frame) { /* @sig public void Put(java.lang.String host, java.lang.String user, java.lang.String passwd, java.lang.String fileName, java.lang.String filePath) */ frame.setlocal(6, frame.getglobal("FTP").__call__(frame.getlocal(1), frame.getlocal(2), frame.getlocal(3))); frame.setlocal(7, frame.getglobal("open").__call__(frame.getlocal(5), s$2)); frame.getlocal(6).invoke("storbinary", new PyObject[] {s$3._add(frame.getlocal(4)), frame.getlocal(7), i$4}); frame.getlocal(6).invoke("quit"); return Py.None; } private static PyObject FTPClient$3(PyFrame frame) { frame.setlocal("__init__", new PyFunction(frame.f_globals, new PyObject[] {}, c$0___init__)); frame.setlocal("Put", new PyFunction(frame.f_globals, new PyObject[] {}, c$1_Put)); return frame.getf_locals(); } private static PyObject main$4(PyFrame frame) { frame.setglobal("__file__", s$0); org.python.core.imp.importFromAs("ftplib", new String[] {"FTP"}, new String[] {"FTP"}, frame); frame.setglobal("FTPClient", Py.makeClass("FTPClient", new PyObject[] {}, c$2_FTPClient, null)); return Py.None; } } public static void moduleDictInit(PyObject dict) { dict.__setitem__("__name__", new PyString("FTPClient")); Py.runCode(new _PyInner().getMain(), dict, dict); } public static void main(String[] args) { String[] newargs = new String[args.length+1]; newargs[0] = "FTPClient"; System.arraycopy(args, 0, newargs, 1, args.length); Py.runMain("tinitools.FTPClient$_PyInner", newargs, jpy$packages, jpy$properties, "tinitools", new String[] {"FTPClient", "sre_compile", "javapath", "sre_constants", "sre_parse", "string", "copy_reg", "ftplib", "javaos", "socket", "re", "sre"}); } } Brad Clements, bk...@mu... (315)268-1000 http://www.murkworks.com (315)268-9812 Fax netmeeting: ils://ils.murkworks.com AOL-IM: BKClements |
From: brian z. <bz...@zi...> - 2001-01-07 14:43:36
|
I was trying to use the following syntax in Jython but I get an exception: >>> t = {} >>> exec open(filename) in t Traceback (innermost last): File "install.py", line 381, in ? File "install.py", line 47, in run File "install.py", line 71, in detectComponents File "install.py", line 89, in readProperties TypeError: exec: argument 1 must be string or code object This works in CPython and appears to be part of the spec: "The first expression should evaluate to either a string, an open file object, or a code object. ... If it is an open file, the file is parsed until EOF and executed." http://python.org/doc/current/ref/exec.html Additionally, in CPython 2.0, if the file is closed it is re-opened and executed. I also tested whether StringIO could be substited for a file and it appears to fail: >>> from StringIO import StringIO >>> s = StringIO("a = 'x'") >>> s <StringIO.StringIO instance at 007E1C1C> >>> t = {} >>> exec s in t Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: exec 1st arg must be string, code or file object >>> Given this, I've enclosed a working diff which mimics the exact behaviour of CPython 2.0. thanks, brian |
From: Brad C. <bk...@mu...> - 2001-01-04 14:13:13
|
I'm writing a Console Snapin for Novell's Console One application. I had this working in JPython (last rev), but recompiling with Jython 2.0b1 produces a .class that fails to function. Unfortunately I did my earlier work using ConsoleOne 1.2c, but upgraded to 1.2d at the same time I switched to Jython. (stupid, I know). I don't think the ConsoleOne upgrade is related to the failure. Anyway, here's the scoop. 1. The Python code fragment: from com.novell.application.console.snapin import Registration from com.novell.application.console.snapin import RegistrationItem from com.novell.application.console.snapin import scope from com.novell.application.console.snapin import Shell from com.novell.admin.ns.nds import NDSNamespace from jarray import array class FTPDSnapin_Registration(Registration): def __init__(self): pass def getRegistration(self): "@sig public com.novell.application.console.snapin.RegistrationItem[] getRegistration()" myscope = scope.NamespaceTypeScope(Shell.SNAPIN_PAGE,NDSNamespace.name,"User") info = array([RegistrationItem(myscope,"com.MurkWorks.FTPD.FTPDSnapin_PageSnapin")],RegistrationItem) return info 2. The import that's failing is from com.novell.admin.ns.nds import NDSNamespace This class is in ConsoleOne.jar, which is in my classpath. Running jython interactively produces this: Jython 2.0beta1 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> from com.novell.admin.ns.nds import NDSNamespace >>> NDSNamespace.name 'NDS' >>> So the import works interactively. 3. I use jythonc to create a deep .jar and have it loaded by ConsoleOne. ConsoleOne produces this diagnostic info: Reordered classpath = ..\ConsoleOne.jar;..\ConsoleOneCore.jar;..\ConsoleOneExt\collections.ja r;..\ConsoleOneExt\jgl3.1.0.jar;..\ConsoleOneExt\jh.jar;..\ConsoleOneEx t\Widgets.jar;..\help;..\ConsoleOneExt\njha.jar;..\ConsoleOneExt\jclient.j ar;..\ConsoleOneExt\jndi.jar;..\ConsoleOneExt\njcl.jar;..\ConsoleOneExt\ NWFS.jar;..\ConsoleOneExt\JReportBeans.zip (note that ConsoleOne.jar is in the classpath) Then this exception: >>> Creating manifest object for C:\Novell\ConsoleOne\1.2\snapins\FTPDSnapin.jar Collection version = Implementation-Version(null) Shell version = Specification-Version(null) Auto detecting registrars in C:\Novell\ConsoleOne\1.2\snapins\FTPDSnapin.jar Loading registrar -> class com.MurkWorks.FTPD.FTPDSnapin_Registration SnapinClassLoader could not load bytes for class com.novell.admin Throwing ClassNotFoundException. Exception while trying to instantiate com/MurkWorks/FTPD/FTPDSnapin_Registration.class - Java Traceback: at org.python.core.Py.ImportError(Py.java:180) at org.python.core.imp.dottedFind(imp.java:414) at org.python.core.imp.importName(imp.java:436) at org.python.core.imp.importName(imp.java:509) at org.python.core.ImportFunction.load(__builtin__.java:962) at org.python.core.ImportFunction.__call__(__builtin__.java:956) at org.python.core.PyObject.__call__(PyObject.java:250) at org.python.core.__builtin__.__import__(__builtin__.java:916) at org.python.core.imp.importFromAs(imp.java:566) at com.MurkWorks.FTPD.FTPDSnapin_Registration$_PyInner.main$4(FTPDSnapin_Registration.java:79) at com.MurkWorks.FTPD.FTPDSnapin_Registration$_PyInner.call_function(FTPDSnapin_Registration.java:48) at org.python.core.PyTableCode.call(PyTableCode.java:155) at org.python.core.imp.createFromCode(imp.java:157) at org.python.core.Py.initProxy(Py.java:726) at com.MurkWorks.FTPD.FTPDSnapin_Registration.<init>(FTPDSnapin_Registration.java:105) at java.lang.Class.newInstance0(Native Method) at java.lang.Class.newInstance(Unknown Source) at com.novell.application.console.shell.DefaultSnapinLister.checkForRegistration(DefaultSnapinLister.java) at com.novell.application.console.shell.DefaultSnapinLister.autoRegister(DefaultSnapinLister.java) at com.novell.application.console.shell.DefaultSnapinLister.loadSCI(DefaultSnapinLister.java) at com.novell.application.console.shell.DefaultSnapinLister.loadSCIs(DefaultSnapinLister.java) at com.novell.application.console.shell.DefaultSnapinLister.getSnapinCollections(DefaultSnapinLister.java) at com.novell.application.console.shell.Registry.registerSnapins(Registry.java) at com.novell.application.console.shell.ConsoleShell.start(ConsoleShell.java) at com.novell.application.console.shell.Console.main(Console.java) Traceback (innermost last): File "C:\Novell\ConsoleOne\1.2\FTPD\FTPDSnapin_Registration.py", line 0, in main ImportError: No module named admin 4. I'm using jdk 1.3 Any suggestions? Brad Clements, bk...@mu... (315)268-1000 http://www.murkworks.com (315)268-9812 Fax netmeeting: ils://ils.murkworks.com AOL-IM: BKClements |
From: Tim P. <ti...@ho...> - 2001-01-04 03:50:36
|
Adding to Finn Bock's reply, it's almost certainly the case that Scott (Knight) is running on a platform with IEEE-754 floating-point hardware, and that the results computed by CPython and Jython were identical. The implementations do differ in how they choose to round the display, though; CPython inherits the fine points of its float I/O from the platform C library, while Java defines it more rigorously. And you're going to get the same results in any language if you use floating point: Java, Python, Jython, C, C++, Perl, Eiffel, LISP, Scheme, Fortran, ... it doesn't matter. This link explains one of the fine points in deadly <wink> detail: http://www.python.org/cgi-bin/moinmoin/RepresentationError > test_var = 0.0 > limit = 0.1 > inc = 0.01 > > while test_var <= limit: > print test_var > test_var = test_var + inc Ever since someone first bumped into this in Fortran in the 1950's (honest!), the "correct" way to write such a loop has been to use an integer index (say "i"), and compute test_var = i * inc inside the loop. Each floating-point operation introduces its own rounding error, and in doing test_var = test_var + inc these errors compound over time. In test_var = i * inc you only suffer one rounding error in test_var. However, none of that changes that (for example) 0.9 is not exactly representable in binary floating-point arithmetic, no matter how you compute it (see the link above). Scott, if you're under the illusion <wink> that decimal fractions are a Good Thing, you'll never be happy with hardware floating point arithmetic. You should look into something like Java's BigDecimal class instead: http://www2.hursley.ibm.com/decimalj/decdef.html as-always-the-fast-drives-out-the-sane-ly y'rs - tim |
From: <bc...@wo...> - 2001-01-03 10:54:47
|
[Scott Knight] >Hello, my name is Scott and I am a Python newbie (2 months). >"hello Scott, what brought you here?" >;^) > >Anyway, I am having the time of my programming life learning Python and >building a serious configuration program in Java/Jython. What I have >noticed when I am doing some loops is an annoying precision error that I >need to work around. The simple code: > >#! /usr/bin/python > >test_var = 0.0 >limit = 0.1 >inc = 0.01 > >while test_var <= limit: > print test_var > test_var = test_var + inc > >always runs to 1 less loop than I need because of this output: > >D:\dev\python\test>jython test_loop.py >0.0 >0.01 >0.02 >0.03 >0.04 >0.05 >0.060000000000000005 >0.07 >0.08 >0.09 >0.09999999999999999 > >With native Python 2.0 in the same platform and 1.52 on Linux, the >output is a little different: > >D:\dev\python\test>test_loop.py >0.0 >0.01 >0.02 >0.03 >0.04 >0.05 >0.06 >0.07 >0.08 >0.09 >0.1 First a huge disclaimer: I know nothing about float point numbers or the strangeness of their implementation. I think CPython-2.0 is faking the output above. If you add a repr(test_var) on the print statement, you get (with CPython-2.0 & win2k): 0.0 0.0 0.01 0.01 0.02 0.02 0.03 0.029999999999999999 0.04 0.040000000000000001 0.05 0.050000000000000003 0.06 0.060000000000000005 0.07 0.070000000000000007 0.08 0.080000000000000002 0.09 0.089999999999999997 0.1 0.099999999999999992 >This is a little more of what I expected. This trivial example looks >harmless enough, but it gets out of hand when the loops are in the 100+ >range. What happens is even the Python only runs to 0.99 instead of 1.0 >like it should. Because the actual value of the float is about as imprecise in CPython as it is in Jython and in java. >The only solution I have come up with is to slightly modify the >increment like: > > test_var = round((test_var + inc), 2) > >so that it cuts off the value every time through. This seems to work >well enough, but I am wondering if there is a better way. > >I also wonder why Jython puts so many decimal places out when Python >keeps the original max of 2. This seems like it could be a Java thing >to me since I have seen similar behavior in Java programs. Jython is getting all its float behavior from java, including the string representation. This cause some difference between CPython, in particular with CPython-2.0 where the str(0.1) and repr(0.1) return different string values (at least is does in my w2k). I don't think the jython implementation of floats and float -> string conversion will be changed much. It has its flaws, but it is consistent with java, and java floats are consistent across platforms. That alone is a valuable improvement compared to CPython (this conclusion is reached based on reading python-dev, not on any actual knowledge of CPython). If jython will be changed to closer compliance with CPython, it will not be done by me. I'll leave that for experts on floating point implementations. regards, finn |
From: Vincent C. <cr...@ne...> - 2001-01-03 09:57:46
|
i have called the PythonInterpreter to execute a python script in a class i call it from another class but the interpreter doesn't actually want to close correctly how can i do to make it right properly ?? thanks |
From: Scott K. <sc...@sc...> - 2001-01-02 22:29:25
|
Hello, my name is Scott and I am a Python newbie (2 months). "hello Scott, what brought you here?" ;^) Anyway, I am having the time of my programming life learning Python and building a serious configuration program in Java/Jython. What I have noticed when I am doing some loops is an annoying precision error that I need to work around. The simple code: #! /usr/bin/python test_var = 0.0 limit = 0.1 inc = 0.01 while test_var <= limit: print test_var test_var = test_var + inc always runs to 1 less loop than I need because of this output: D:\dev\python\test>jython test_loop.py 0.0 0.01 0.02 0.03 0.04 0.05 0.060000000000000005 0.07 0.08 0.09 0.09999999999999999 With native Python 2.0 in the same platform and 1.52 on Linux, the output is a little different: D:\dev\python\test>test_loop.py 0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 This is a little more of what I expected. This trivial example looks harmless enough, but it gets out of hand when the loops are in the 100+ range. What happens is even the Python only runs to 0.99 instead of 1.0 like it should. The only solution I have come up with is to slightly modify the increment like: test_var = round((test_var + inc), 2) so that it cuts off the value every time through. This seems to work well enough, but I am wondering if there is a better way. I also wonder why Jython puts so many decimal places out when Python keeps the original max of 2. This seems like it could be a Java thing to me since I have seen similar behavior in Java programs. Thanks in advance. -- Scott Knight mailto:sc...@sc... |
From: <bc...@wo...> - 2000-12-31 16:00:40
|
I am happy to announce the first beta release of Jython 2.0. Jython is a Java implementation of the Python programming language. It allows users to compile Python source code to Java byte codes, and run the resulting bytecodes on any Java Virtual Machine. It is a very seamless and smooth integration with Java: from Python you have complete access to all Java libraries, can build applets, can integrate with Java beans, and can subclass Java classes in Python and vice versa. Like Python, and unlike Java, Jython can also be used interactively: just type some Jython code at the prompt and see the results immediately. A java installer is available for download at the Jython website: http://jython.sourceforge.net/ Installation is started by running the installer class. Further information and tips on installation is available at: http://jython.sourceforge.net/install.html Jython 2.0 is feature compatible with Python 2.0 and among the new features are: - Augmented assignment, e.g. x += 1 - List comprehensions, e.g. [x**2 for x in range(10)] - Extended import statement, e.g. import Module as Name - Extended print statement, e.g. print >> file, "Hello" The changes from alpha 3 include: New features - Installer logo by Ivan Kougaenko. The logo competition is still open, so submit you suggestions. - The default packages selected in the installer are now better attuned to the users (as opposed to the jython developers). Bug fixes. - Fixed a NPE when a class is defined in non-module namespace. - Fixed a compilation problem when using JDK1.2.x - The installer now creates a useable Uninstall.class. A complete list of changes and differences are available here: http://jython.sourceforge.net/NEWS.html Bugs can be reported to the bug manager on SourceForge: http://sourceforge.net/bugs/?group_id=12867 Cheers, the jython-developers |
From: <bc...@wo...> - 2000-12-29 22:37:17
|
[L. Humbert] >ok I'm working on Linux and on MacOS. >I installed the latest jython 2.0a3 on both machines: > >Linux: >Jython 2.0alpha3 on java1.2.2 (JIT: sunwjit) >MacOS: >Jython 2.0alpha3 on java1.1.8 (JIT: MRJ22Jitc.01) > >A little project in training the presentation of some >xml-data which describe the layout of computer-infrastructure at work >(the first steps were done with Python2.0). My students didn't have the >time to implement, so I gave it a try on jython: >xmllib is part of the actual jython-distribution. > >Here begins my problem: >on my linux-machine everything works fine. > >But after shifting the runable-source-code to the Mac I get some strange >errors. >After I found out that most of them could be eliminated, because I >did'nt set the path in the right way, >one serious error is still remaining: > >Error around line 505 of xmllib.py >Ok, I gave it a try >pure >xmllib --> jython 2.0a3 >invalid syntax, line 508 >ok I decided to import xmllib at the command line >sre_parse.py line 504 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >Jython 2.0alpha3 on java1.1.8 (JIT: MRJ22Jitc.01) >Type "copyright", "credits" or "license" for more information. >>>> import xmllib >Traceback (innermost last): > File "<console>", line 1, in ? > File "/brecht/Systemordner/Preferences/jython-2.0a3/Lib/xmllib.py", >line 5, in ? > File "/brecht/Systemordner/Preferences/jython-2.0a3/Lib/re.py", line >28, in ? > File "/brecht/Systemordner/Preferences/jython-2.0a3/Lib/sre.py", line >20, in ? > File "/brecht/Systemordner/Preferences/jython-2.0a3/Lib/sre_parse.py", >line 504 >SyntaxError: inconsistent dedent >>>> > >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >As workaround, I set the sys.path so, that the Python2.0 Libs where >used. >The same effect appears. > >Perhaps there is someone out there, who is able to check it on a Mac, >too. > >The problems doesn't arrive on my Linux-System. I strongly suspect that there is a bug in the JVM for mac. Previously we have seen other problems with the MRJ22 jvm: http://www.geocrawler.com/archives/3/7018/2000/10/0/4557089/ If anyone have a workaround for these problems, I would dearly love to include it. Unfortunately I don't have a neither a Mac nor any knowledge on how to use it. regards, finn |
From: L. H. <hu...@ha...> - 2000-12-27 19:11:46
|
Hi, ok I'm working on Linux and on MacOS. I installed the latest jython 2.0a3 on both machines: Linux: Jython 2.0alpha3 on java1.2.2 (JIT: sunwjit) MacOS: Jython 2.0alpha3 on java1.1.8 (JIT: MRJ22Jitc.01) A little project in training the presentation of some xml-data which describe the layout of computer-infrastructure at work (the first steps were done with Python2.0). My students didn't have the time to implement, so I gave it a try on jython: xmllib is part of the actual jython-distribution. Here begins my problem: on my linux-machine everything works fine. But after shifting the runable-source-code to the Mac I get some strange errors. After I found out that most of them could be eliminated, because I did'nt set the path in the right way, one serious error is still remaining: Error around line 505 of xmllib.py Ok, I gave it a try pure xmllib --> jython 2.0a3 invalid syntax, line 508 ok I decided to import xmllib at the command line sre_parse.py line 504 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jython 2.0alpha3 on java1.1.8 (JIT: MRJ22Jitc.01) Type "copyright", "credits" or "license" for more information. >>> import xmllib Traceback (innermost last): File "<console>", line 1, in ? File "/brecht/Systemordner/Preferences/jython-2.0a3/Lib/xmllib.py", line 5, in ? File "/brecht/Systemordner/Preferences/jython-2.0a3/Lib/re.py", line 28, in ? File "/brecht/Systemordner/Preferences/jython-2.0a3/Lib/sre.py", line 20, in ? File "/brecht/Systemordner/Preferences/jython-2.0a3/Lib/sre_parse.py", line 504 SyntaxError: inconsistent dedent >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ As workaround, I set the sys.path so, that the Python2.0 Libs where used. The same effect appears. Perhaps there is someone out there, who is able to check it on a Mac, too. The problems doesn't arrive on my Linux-System. TNX Ludger |
From: L. H. <hu...@ha...> - 2000-12-27 06:31:47
|
Hi, After installing I decided to document my process of installing Jython on the MacOS. Perhaps this information may find its place on: http://jython.sourceforge.net/platform.html You can get the whole thing Mac_OS_Jython_Inst.zip 334 K (342239 bytes) at: http://bscw.hagen.de/pub/german.cgi/0/565865 --> Jython For working, I use several techniques: one is PyPad http://homepage.mac.com/ballabio/PyPad/ TNX L. Humbert |
From: salvatore.didio <sal...@wa...> - 2000-12-25 23:22:49
|
Hello Finn, Thanks for your work I don't file any jython class file in the package Regards Salvatore ----- Original Message ----- From: Finn Bock <bc...@wo...> To: <jyt...@li...> Cc: <jyt...@li...>; <jyt...@li...>; <jpy...@py...> Sent: Monday, December 25, 2000 8:11 PM Subject: [JPython] Third alpha release of Jython-2.0 > Jython-2.0a3 is now available. > > http://jython.sourceforge.net/index.html > > Install as with Jython-2.0a2. I don't intend to announce this any > more widely than these lists for now. > > The release includes some bug fixes: > > Bug fixes. > - Fixed a bug that caused Infinite recursion in subpackage > import > - Fixed conversion error when a long is converted to a java double. > - Fixed a bug where an attribute in a package __init__.py would > hide a submodule. > - Fixed missing quotes around the path to java.exe in jython.bat > for windows. > - Include missing re.py in installer. > - Added threading and atexit modules from CPython2.0. > > > Take a look at the NEWS file for more information about the differences. > > http://jython.sourceforge.net/NEWS.html > > Bugs can be reported to the bug manager on SourceForge: > > http://sourceforge.net/bugs/?group_id=12867 > > Cheers, > the jython-developers > > _______________________________________________ > JPython-Interest maillist - JPy...@py... > http://www.python.org/mailman/listinfo/jpython-interest |
From: <bc...@wo...> - 2000-12-25 19:11:27
|
Jython-2.0a3 is now available. http://jython.sourceforge.net/index.html Install as with Jython-2.0a2. I don't intend to announce this any more widely than these lists for now. The release includes some bug fixes: Bug fixes. - Fixed a bug that caused Infinite recursion in subpackage import - Fixed conversion error when a long is converted to a java double. - Fixed a bug where an attribute in a package __init__.py would hide a submodule. - Fixed missing quotes around the path to java.exe in jython.bat for windows. - Include missing re.py in installer. - Added threading and atexit modules from CPython2.0. Take a look at the NEWS file for more information about the differences. http://jython.sourceforge.net/NEWS.html Bugs can be reported to the bug manager on SourceForge: http://sourceforge.net/bugs/?group_id=12867 Cheers, the jython-developers |
From: <bc...@wo...> - 2000-12-25 00:37:32
|
[Robert W. Bill] >Also, is it known why the posted example crashes if I use >"self.username" as an instance variable instead of the current >"self.usrname"? I'll have time next week to find out, just curious if ppl >already knew so I could save some time. It is because the getUsername / setUsername methods creates a bean property called "username". Reading or writing to this beanproperty (which is done in the set/get methods) will call the set/get methods again. The good news are that it is easy to work around (as you did) and you'll recognize it immediately the next time it happen. regards, finn |
From: Robert W. B. <rb...@di...> - 2000-12-24 00:47:58
|
[Finn] > I think that you have jython.jar included on your CLASSPATH before > starting tomcat, correct? Yes. > With tomcat 4.0m5 (the only one I have tested with) I had success with > copying jython.jar to %TOMCAT_HOME%\webapps\jython\WEB-INF\lib. This way > the deployment .war can be completely self contained. Excellent! Do you then use TOMCAT_OPTS to set python.home? It seems Jython reads the registry from wherever it finds the jython.jar if I don't set python.home- I'm worried about what happens when a client has 2+ Jython webapps that are self-contained this way. I'll have to try and find out. Also, is it known why the posted example crashes if I use "self.username" as an instance variable instead of the current "self.usrname"? I'll have time next week to find out, just curious if ppl already knew so I could save some time. -Robert |
From: <bc...@wo...> - 2000-12-23 23:29:03
|
[Robert W. Bill] >I've had progress with JSP and Jython and thought I would post >some info for those that expressed interest. > >My previous posts noted difficulty in using jythonc compiled files with >JSP on Windows. However, the machine I was using had multiple JDK's >installed. Because of my troubles, I uninstalled all jdks and >re-installed only sun's 1.2.2 (out of convenience- I had the installer on >the desktop), and all of the JSP problems that I was having are >gone. It's odd that other Java apps were working fine, and I was sure >tomcat and jython/jythonc both pointed to the same jdk, but nonetheless >this was a solution for me. Good to hear that it worked out. >A simple example of using Jythonc classes with tomcat is (using Tomcat >3.2, jdk1.2.2_07, Win98): > >1. Make a context ("jython" in this example). > >2. compile following jython file with >"jythonc NameHandler.py" >(NOTE: changing the instance variable "usrname" to "username" is >catastrophic- very interesting ;) > >--------------jython file: NameHandler.py---------------- >import java > >class NameHandler(java.lang.Object): > def __init__(self): > self.usrname = "Fred" > def getUsername(self): > "@sig public String getname()" > return self.usrname > def setUsername(self, name): > "@sig public void setname(java.lang.String name)" > self.usrname = name >---------------------------------------------------------- > >3. Copy NameHandler.class & NameHandler$_PyInner.class to >\%TOMCAT_HOME%\webapps\jython\WEB-INF\classes > >4. Make test.jsp file from below > >--------------jsp file: test.jsp-------------------------- ><%@ page import = "mytest" %> > ><html> ><head><title>hello</title></head> ><body bgcolor="white"> >Hello, my name is ><% NameHandler nh = new NameHandler(); %> ><%= nh.getUsername() %> <br> >No! wait... ><% nh.setUsername("Robert"); %> >, It's really <%= nh.getUsername() %>. > ></font> ></body> ></html> >----------------------------------------------------------- > >5. Place test.jsp file in >context (ie- "\%TOMCAT_HOME\webapps\jython\jsp\test.jsp") > >Restart Tomcat and visit >"http://localhost:8080/jython/jsp/test.jsp". This >is it. I think that you have jython.jar included on your CLASSPATH before starting tomcat, correct? With tomcat 4.0m5 (the only one I have tested with) I had success with copying jython.jar to %TOMCAT_HOME%\webapps\jython\WEB-INF\lib. This way the deployment .war can be completely self contained. regards, finn |
From: Robert W. B. <rb...@di...> - 2000-12-23 22:02:42
|
Hello all, I've had progress with JSP and Jython and thought I would post some info for those that expressed interest. My previous posts noted difficulty in using jythonc compiled files with JSP on Windows. However, the machine I was using had multiple JDK's installed. Because of my troubles, I uninstalled all jdks and re-installed only sun's 1.2.2 (out of convenience- I had the installer on the desktop), and all of the JSP problems that I was having are gone. It's odd that other Java apps were working fine, and I was sure tomcat and jython/jythonc both pointed to the same jdk, but nonetheless this was a solution for me. A simple example of using Jythonc classes with tomcat is (using Tomcat 3.2, jdk1.2.2_07, Win98): 1. Make a context ("jython" in this example). 2. compile following jython file with "jythonc NameHandler.py" (NOTE: changing the instance variable "usrname" to "username" is catastrophic- very interesting ;) --------------jython file: NameHandler.py---------------- import java class NameHandler(java.lang.Object): def __init__(self): self.usrname = "Fred" def getUsername(self): "@sig public String getname()" return self.usrname def setUsername(self, name): "@sig public void setname(java.lang.String name)" self.usrname = name ---------------------------------------------------------- 3. Copy NameHandler.class & NameHandler$_PyInner.class to \%TOMCAT_HOME%\webapps\jython\WEB-INF\classes 4. Make test.jsp file from below --------------jsp file: test.jsp-------------------------- <%@ page import = "mytest" %> <html> <head><title>hello</title></head> <body bgcolor="white"> Hello, my name is <% NameHandler nh = new NameHandler(); %> <%= nh.getUsername() %> <br> No! wait... <% nh.setUsername("Robert"); %> , It's really <%= nh.getUsername() %>. </font> </body> </html> ----------------------------------------------------------- 5. Place test.jsp file in context (ie- "\%TOMCAT_HOME\webapps\jython\jsp\test.jsp") Restart Tomcat and visit "http://localhost:8080/jython/jsp/test.jsp". This is it. Using jythonc compiled files, importing org.python.util.PythonInterpreter directly in the jsp, and writing java classes/beans that import PythonInterpreter have now all worked well for me with JSP. My next step is a snappy jython memento for persistence- maybe even setting python.security.respectJavaAccessibility = false to see what things can be done then. All hints welcome. -Robert |
From: Robert W. B. <rb...@di...> - 2000-12-22 21:30:56
|
Hello all, This was originally on the jython-dev list, but I thought it might be more appropriate here... [Ray] > On Thu, 21 Dec 2000, Ray Leyva wrote: > > Just wondering. Cause we're building a site based solely on Java, and > > JSP. I was wondering if it was possible to use Jython from with JSP, > > and if so can someone send a really really simple ( rudimentary ) > > FooBar, World! style sample. > > > > thx > > rl [Me] > I'm been looking at this as well. So far, I'm unable to use a jythonc > compiled file with Tomcat jsp due to a StackOverflow in __init__ or other > problems loading the inner class. I think I'm missing something though. I've come to a point where I need to ask people what it is I'm missing. The dilemna is the use of jythonc generated classes in JSP pages. For example, I can have a jython class and .jsp page as follows (roughly from Frank Chen's original examples): -------------file: mytest.py--------------------- import java class mytest(java.lang.Object): def __init__(self): self.name = "Jerry" def myget(self): "@sig public String myget()" return self.name def myset(self, name): "@sig public void myset(java.lang.String name)" self.name = name ---------------------------------------------------- This is compiled with "jythonc mytest.py". ------------file: test.jsp------------------- <%@ page import = "mytest" %> <html> <head><title>Jython Test</title></head> <body bgcolor="white"> <% mytest mt = new mytest(); %> My name is <%= mt.myget() %> <% mt.myset("Robert"); %> <br>No, wait, it's <%= mt.myget() %> </font></body></html> ----------------------------------------------- I have never gotten the jythonc compiled file to work, but until today my JSP work was stuck on a win98 machine. Today, I find out that any of my jythonc compiled files work fine on my linux and Solaris boxes. It is as simple as write anything in jython, compile with jythonc and use the <%@ page import = "filename" %> to use it in JSP, with the above example being just the tip of the iceburg. On win98 I still receive a StackOverflow. I have edited the memory properties of the dos .lnk that I use to start tomcat on Windows, and have been through all possible permutations of settings as well as eliminating any backgrounded processes (I think called TSR's on windows?). I still cannot avoid the StackOverflow when Jasper loads the requested jythonc compiled file. All boxes are using Sun jdk1.3, jython-2.0a2, and have 64mb ram. I was hoping that someone who understands windows (not me) could help provide some hints on getting it working. Was editing the .lnk memory properties a likely answer? My memory monitor does not show memory totally full- can I adjust the stack size java uses? Am I looking entirely in the wrong direction by focussing on memory allocation? All classloaders are the same (Jasper/tomcat/sunjdk1.3) so it's not likely jvm/servlet-container. I do not have any additional windows machines to test this on to see if it would be a setup problem on one machine. My sincere thanks in advance for any suggestions. -Robert |
From: <bc...@wo...> - 2000-12-20 13:51:05
|
[Barry Haddow] >Is the following behaviour correct? > >Jython 2.0alpha1 on java1.2.2 (JIT: javacomp) >Type "copyright", "credits" or "license" for more information. >>>> from time import * >>>> secs = 977232600L >>>> ctime(secs) >Traceback (innermost last): > File "<console>", line 1, in ? >TypeError: ctime(): 1st arg can't be coerced to double >>>> ctime(float(secs)) >'Tue Dec 19 13:30:00 2000' No, it is a bug. I just checked in a patch. Thanks for the bug report. regards, finn |
From: Barry H. <b.h...@sc...> - 2000-12-20 11:51:55
|
Hi Is the following behaviour correct? Jython 2.0alpha1 on java1.2.2 (JIT: javacomp) Type "copyright", "credits" or "license" for more information. >>> from time import * >>> secs = 977232600L >>> ctime(secs) Traceback (innermost last): File "<console>", line 1, in ? TypeError: ctime(): 1st arg can't be coerced to double >>> ctime(float(secs)) 'Tue Dec 19 13:30:00 2000' >>> In cpython it works without the cast: Python 1.5.2 (#9, Feb 7 2000, 00:10:53) [GCC 2.95.1 19990816 (release)] on linux2 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> from time import * >>> secs = 977232600L >>> ctime(secs) 'Tue Dec 19 13:30:00 2000' >>> cheers Barry |
From: <bc...@wo...> - 2000-12-18 21:59:43
|
[Brian Zimmer] >This is a multi-part message in MIME format. > >------_=_NextPart_001_01C06920.5186FCDF >Content-Type: text/plain; > charset="iso-8859-1" >Content-Transfer-Encoding: quoted-printable > >I am using the latest CVS code and can no longer import the CPython 2.0 >cgi module: > >D:\>jython >Listening for transport dt_socket at address: 3540 >Jython 2.0alpha2 on java1.3.0 (JIT: null) >Type "copyright", "credits" or "license" for more information. >>>> import cgi >internal compiler error: Name:s1 at line 195 Obviously a bug. It occur because a more stringent fast-locals algorithm was added in a2 (this fix a bug when "exec" staments assign to a local and make jython more CPython compatible). The new algorithmt assume that all locals have been detected correctly where the a1 would use a slower string based local lookup when in doubt. The trigger is the local assignments in list comprehension that wasn't detected correctly. "s1" and "s2" and locals in defining block: pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')] A patch have now been checked into CVS. regards, finn |
From: Brian Z. <bz...@ig...> - 2000-12-18 18:31:55
|
I am using the latest CVS code and can no longer import the CPython 2.0 cgi module: D:\>jython Listening for transport dt_socket at address: 3540 Jython 2.0alpha2 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import cgi internal compiler error: Name:s1 at line 195 Traceback (innermost last): File "<console>", line 1, in ? java.lang.NullPointerException at org.python.compiler.CodeCompiler.Name(CodeCompiler.java:2237) at org.python.parser.SimpleNode.visit(SimpleNode.java:326) at org.python.compiler.CodeCompiler.set(CodeCompiler.java:110) at org.python.compiler.CodeCompiler.for_stmt(CodeCompiler.java:884) at org.python.parser.SimpleNode.visit(SimpleNode.java:224) at org.python.compiler.CodeCompiler.list_comprehension(CodeCompiler.java:19 50) at org.python.compiler.CodeCompiler.list(CodeCompiler.java:1906) at org.python.parser.SimpleNode.visit(SimpleNode.java:296) at org.python.compiler.CodeCompiler.expr_stmt(CodeCompiler.java:352) at org.python.parser.SimpleNode.visit(SimpleNode.java:190) at org.python.compiler.CodeCompiler.suite(CodeCompiler.java:1116) at org.python.parser.SimpleNode.visit(SimpleNode.java:230) at org.python.compiler.CodeCompiler.parse(CodeCompiler.java:185) at org.python.compiler.Module.PyCode(Module.java:370) at org.python.compiler.CodeCompiler.funcdef(CodeCompiler.java:324) at org.python.parser.SimpleNode.visit(SimpleNode.java:178) at org.python.compiler.CodeCompiler.suite(CodeCompiler.java:1116) at org.python.compiler.CodeCompiler.file_input(CodeCompiler.java:240) at org.python.parser.SimpleNode.visit(SimpleNode.java:174) at org.python.compiler.CodeCompiler.parse(CodeCompiler.java:185) at org.python.compiler.Module.PyCode(Module.java:370) at org.python.compiler.Module.compile(Module.java:506) at org.python.core.imp.compileSource(imp.java:119) at org.python.core.imp.compileSource(imp.java:102) at org.python.core.imp.createFromSource(imp.java:142) at org.python.core.imp.loadFromPath(imp.java:316) at org.python.core.imp.loadFromPath(imp.java:252) at org.python.core.imp.load(imp.java:357) at org.python.core.imp.load(imp.java:376) at org.python.core.imp.importName(imp.java:446) at org.python.core.imp.importName(imp.java:508) at org.python.core.ImportFunction.load(__builtin__.java:962) at org.python.core.ImportFunction.__call__(__builtin__.java:956) at org.python.core.PyObject.__call__(PyObject.java:250) at org.python.core.__builtin__.__import__(__builtin__.java:916) at org.python.core.imp.importOne(imp.java:517) at org.python.pycode._pyx1.f$0(<console>) at org.python.pycode._pyx1.call_function(<console>) at org.python.core.PyTableCode.call(PyTableCode.java:155) at org.python.core.Py.runCode(Py.java:1050) at org.python.core.Py.exec(Py.java:1064) at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:124) at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.ja va:87) at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter. java:68) at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter. java:42) at org.python.util.InteractiveConsole.push(InteractiveConsole.java:83) at org.python.util.InteractiveConsole.interact(InteractiveConsole.java:62) at org.python.util.jython.main(jython.java:178) java.lang.NullPointerException: java.lang.NullPointerException >>> This worked with alpha1 on Windows 2000, jdk1.3 thanks, brian |
From: <bc...@wo...> - 2000-12-17 22:28:34
|
Jython-2.0a2 is now available. http://jython.sourceforge.net/index.html Install as with Jython-2.0a1. I don't intend to announce this any more widely than these lists for now. The release includes some bug fixes as well as a few but crucial new features. New features: - Added -v (verbose) option to jython command. It will trace import statements. Use three -v's for maximum information. - A redesigned of the internal java class handling. The new design allow for a pluggable javaclass -> PyJavaClass handling. Included are plugins that use weak or soft references. - Use a SecureClassLoader for loading compiled python modules. This should allow jython to be used with the java plugin and its fine grained security. CPython-2.0 compatibility - Added support for formatting of long values in "%d %x %X %o". The support does not match CPython2.0 exactly, but matches what CPython2.1 will do. - The \x escape will only eat two hex characters and will always create a character with values < 256. Use the \u escape for high-byte values. - A ucnhash module to support the \N{name} escape. Take a look at the NEWS file for more information about the differences. http://jython.sourceforge.net/NEWS.html Bugs can be reported to the bug manager on SourceForge: http://sourceforge.net/bugs/?group_id=12867 Cheers, the jython-developers |
From: Frank C. <fr...@ms...> - 2000-12-15 03:39:04
|
Ah! I was wrong again! I put test.py in a wrong place. Nothing wrong! Sorry for these things! > > > > So, how can I use execfile() method? > > PythonInterpreter interp = new PythonInterpreter(); > ........ > interp.execfile("test.py"); > > I cannot run it in the JSP framework, but it is normal in ordinary Java > code. > > Frank chen > |
From: Frank C. <fr...@ms...> - 2000-12-15 02:59:05
|
> I didn't mean to import the PythonInterpreter in the JSP code. I > actually was thinking about instances (no pun intended) where > writing a java class that imports PythonInterpreter acts as the > proxy for python files. In this case, import the java class in > the JSP, initialize PythonInterpreter in the java class, then use > the java class's interfaces to get at your python files. > So, how can I use execfile() method? PythonInterpreter interp = new PythonInterpreter(); ....... interp.execfile("test.py"); I cannot run it in the JSP framework, but it is normal in ordinary Java code. Frank chen |