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: Robert W. B. <rb...@vi...> - 2002-01-11 19:03:51
|
On Fri, 11 Jan 2002, Sean McGrath wrote: >I can compile a java app that, say, imports javax.xml.transform but >cannot get jython to see the package. jython can see certain other >parts of javax such as servlet, swing but not the xml parts. Does sys.add_package("javax.xml.transform") help? |
From: Justin S. <ju...@ia...> - 2002-01-11 18:25:34
|
dman <ds...@ri...> writes: > | Is there some way that a Jython class can expose public static class > | methods to Java modules? > > No. > > | Perhaps I should write the Python module and then write a Java adapter > | to provide the proper interface? > > You can either create an instance of the class to invoke methods on, > or make an adapter in java that hides the java<->python interface > differences. That's pretty much what I epxected, though it was worth asking. Thanks for the info. -Justin |
From: Sean M. <sea...@pr...> - 2002-01-11 18:09:27
|
I have a weird import problem and (unusually) have drawn a blank with Google. I can compile a java app that, say, imports javax.xml.transform but cannot get jython to see the package. jython can see certain other parts of javax such as servlet, swing but not the xml parts. Any pointers appreciated. regards, Sean |
From: Paul P. <pa...@pr...> - 2002-01-11 17:12:19
|
Finn Bock wrote: > >... > > The single argument unicode() call will use the default encoding. That > can be changed to something other than "ascii" and then a no-op makes > less sense: > > [d:\]p22 -S There is a reason you needed to put in that -S. Changing the default encoding is not recommended and is not really officially supported. I would suggest that a higher priority be put on normal uses than on variant ones. In the interest of full disclosure, I have been a strong critic of the idea that there should be a per-machine changable default encoding. Obviously enough people agree with me that it hasn't been made a standard feature yet. A public sys.setdefaultencoding would be a bad idea because: * it is a global variable, with all of the typical scalability problems that implies. Setting it in one place could break code in some library module you don't know about. * it doesn't work well with a networked world where information coming off the network could be in random encodings based on other people's machine encodings Paul Prescod |
From: Phil S. <psu...@es...> - 2002-01-11 17:06:54
|
I'm creating a build file that automatically creates a distribution of ant with a bunch of included addons, the most important of which is jython. The script automatically pulls down the jython distribution from jython.org and then tries to extract the files from it as if it was a .zip file. Problems (with jython-21.class under linux): - ant's unzip task simply won't unzip it - infozip's unzip tool can unzip it (phew) but the permissions of the unzipped files are all empty (no permissions). When I use infozip on other zip files I don't have this problem. I guess this is liftoff issue and not a jython issue, just thought everyone should know. My vote is for a stanadard jar distribution of jython in the next release! - Phil Surette |
From: Jeff E. <je...@ad...> - 2002-01-11 15:55:47
|
brian zimmer wrote: > If you choose to use (2), the following will create the correctly typed > array: > > Class c = Array.newInstance(PyArray.char2class('i'), 0).getClass(); > > <note> > I am not sure of another way to get an 'int[]' Class instance. Does > anyone else? I'm surely missing something though this works. > </note> java.lang.Class.forName("[I") |
From: ¹Ú¼ºÈÆ<qkr...@ya...> - 2002-01-11 14:33:23
|
<html> <head> <title>▒▒▒▒▒ Mono ▒▒▒▒▒</title> <meta http-equiv="Content-Type" content="text/html; charset=euc-kr"> <style type="text/css"> <!-- a.cls0:link { text-decoration: none; color:#660066; font-size:10pt; font-family:"굴림";} a.cls0:visited { text-decoration: none; color:#660099; font-size:10pt; font-family:"굴림";} a.cls0:hover { text-decoration: none; color:#660099; font-size:10pt; font-family:"굴림";} .mylink { color:#333333; font-size:12px; font-family:"굴림";} --> </style> <link rel="stylesheet" href="http://idlsesang.hihome.com/images/board.css" type="text/css"> </head> <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td> </td> </tr> <tr> <td align="center"> <table width="570" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="1" bgcolor="#000000" height="1"><img src="img/spacer.gif" width="1" height="1"></td> <td height="1" bgcolor="#333333"> <p><img src="http://idlsesang.hihome.com/images/spacer.gif" width="1" height="1"></p> </td> <td width="1" bgcolor="#000000"><img src="http://idlsesang.hihome.com/images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td width="1" bgcolor="#000000"><img src="http://idlsesang.hihome.com/images/spacer.gif" width="1" height="1"></td> <td width="*"> <table width="570" border="0" cellpadding="0" cellspacing="0" class="mylink1"> <tr> <td width="178" height="600"><img src="http://idlsesang.hihome.com/images/1.gif" width="178" height="600"></td> <td width="392" height="600" background="http://idlsesang.hihome.com/images/2.gif" align="right"> <table width="94%" border="0" cellpadding="0" cellspacing="0" class="mylink" height="600"> <tr> <td bgcolor="#FFFFFF"> <p> </p> </td> </tr> <tr> <td bgcolor="#FFFFFF"> <p> </p> </td> </tr> <tr> <td bgcolor="#FFFFFF"> <p> </p> </td> </tr> <tr> <td bgcolor="#FFFFFF"> <p> </p> </td> </tr> <tr> <td bgcolor="#FFFFFF">안녕하십니까! <br> 저희 <span class="bold">모노디자인</span>은 웹에 관련된 기술을 보유하고 있는 회사 입니다.<br> 아래 내용과 귀사의 입장이 일치하신다면 저희 모노와 상담해 <br> 보십시요. </td> </tr> <tr> <td class="small11">1. 회사의 전략적인 홈페이지를 제작하려한다.<br> 2. 어떤 업체를 선정해야하는지 기준이 모호하여 업체선정에 애로가<span class="body_white">1. </span>있다.<br> 3. 사이트 제작 후에도 원활한 관리와 파트너쉽을 가지고 일할 수 <br> <span class="body_white">1. </span>있는 업체가 필요하다.<br> 4. 사이트 제작 전 회사의 전략적인 부분과 유기적으로 진행 될 <br> <span class="body_white">1. </span>사이트의 기획이 어렵다.<br> 5. 허접스런 사이트가 아닌 고급스럽고 독창적인 사이트를 원한다.<br> 6. 현재 사이트가 있는데 디자인을 개편하려한다.<br> 7. 제작하려는 사이트의 적정 가격이 얼마나 되는지 궁굼하다.<br> 8. 믿을만한 규모와 작업 성과가 있는 업체를 찾고 있다.</td> </tr> <tr> <td> <p><span class="bold">모노디자인</span>은 항상, interactive medium으로부터 최대한의 수익을 <br> 올리기 위해 제작기법이 고객의 컨텐츠와 목표에 부합되어야 <br> 한다는 점을 잊지 않고 있습니다.<br> 저희 모노디자인은 노력하는 업체입니다.<br> 머무르지않고 연구하고 최신의 기술을 적용하기위해 최선을 다하고 있습니다.<br> 모노의 전문가들은 Java, Shockwave, JSP, ASP, VRML,Client-Server Network 통합,XML, SSL, SQL, EJB 그리고 동적으로 연동<br> 하는 HTML등과 수반되는 back-end DB Application를 수행할 수 <br> 있습니다.<br> CRM , ERP 도입은 저희 모노에 협의 하시기 바랍니다.</p> <p><br> <br> <span class="bold">모노디자인</span>은 양질의 서비스와 높은 기술력을 보여 드립니다.</p>문의사항이 있으시면 메일 <a href="mailto:mo...@mo...">mo...@mo... </a>으로 주시면 <br>최선을 다해 응대하겠습니다. </td> </tr> <tr> <td> </td> </tr> </table> </td> </tr> <tr align="center"> <td colspan="2"> <A href="http://monoin.com/"><img src="http://idlsesang.hihome.com/images/sig.gif" width="400" height="188"> </a> </td> </tr> <tr align="center"> <td colspan="2"> </td> </tr> <tr align="center"> <td colspan="2" class="body">귀하의 메일주소는 웹서핑중알게 된것이며,E-Mail 주소 외에, 다른 정보는 갖고 있지 않습니다.<br> 정통부 권고사항에 의거 제목에 [광고]라고 표기한 메일입니다. 원치 않으면 <a href="mailto:mo...@ch...?subject=수신을 거부합니다.&body=다음부터 메일을 보내지 말아주세요."><font color="blue"><u>수신거부</u></font>수신거부</a>를 눌러주세요 </td> </tr> </table> </td> <td width="1" bgcolor="#000000"><img src="http://idlsesang.hihome.com/images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td width="1" bgcolor="#000000"><img src="http://idlsesang.hihome.com/images/spacer.gif" width="1" height="1"></td> <td height="1" bgcolor="#000000"><img src="http://idlsesang.hihome.com/images/spacer.gif" width="1" height="1"></td> <td width="1" bgcolor="#000000"><img src="http://idlsesang.hihome.com/images/spacer.gif" width="1" height="1"></td> </tr> </table> <p class="body"> </p> <p class="body"> </p> </td> </tr> </table> </body> </html> |
From: Syver E. <syv...@on...> - 2002-01-11 13:40:32
|
Are there any plans for having a more complete socket implementation for jython?. I don't know java at all, how would one to async socket programming with the underlying java api (in jython of course). -- Vennlig hilsen Syver Enstad |
From: <bc...@wo...> - 2002-01-11 13:18:00
|
On Thu, 10 Jan 2002 19:49:45 -0500, you wrote: [Paul Prescod wrote] > Is that a problem? If the user specifies an encoding then you could > decode. If they don't, I would suggest to just do a no-op. Under what > circumstances would the current exception be more helpful? [Brian Quinlan] > Because you are specifically looking for the exception to see if the > string can be converted to a Unicode object using the default encoding? No, it's because you can change the codec used to something more usefull than the default "ascii". [dman] >Is it supposed to be an error when trying to convert a unicode object >to a unicode object? I don't think so. And I agree. Passing a unicode object to unicode() should have been a no-op. Jython only has this 'problem' because we can't have different execution paths based on the type of string objects. regards, finn |
From: <bc...@wo...> - 2002-01-11 10:49:03
|
>> Then unicode() would be a no-op. It would just return the argument >> without doing anything. [Paul Prescod] >Is that a problem? If the user specifies an encoding then you could >decode. If they don't, I would suggest to just do a no-op. Under what >circumstances would the current exception be more helpful? The single argument unicode() call will use the default encoding. That can be changed to something other than "ascii" and then a no-op makes less sense: [d:\]p22 -S 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. >>> import sys >>> sys.setdefaultencoding("cp1253") >>> unicode("\x80") u'\u20ac' >>> regards, finn |
From: Jan W. <j.w...@sc...> - 2002-01-11 10:08:28
|
On Fri, Jan 11, 2002 at 10:31:08AM +0200, Roman Yakovenko wrote: > Hi. I am using python for my programs for 6 month. Our company product > client part written in Visual Basic 6.0. (Something realy big) > Now my company searching for Java programer in order to port our produc= t > to run under WEB browser. As for me I'de like Jython instead of > Java. So my question is: could you point me to some resources or > projects or examples or something that will help me to convince to use > Jython instead of > Java. And if so where can we get support ? At first, I think your request would be better in jython-user, since ther= e are more people there who are using jython. I have cc'ed jython-user on this = mail. Secondly, I know of no publicly available larger jython projects. I mysel= f am using jython for GUI development with swing, but this is nothing I would = display now. Arguments for using jython over java could be derived from arguments for = Python itself. Like dynamic typing, functions as first class objects, etc... see www.python.org. The Java integration is really very good, so its easy to = use java classes from jython and also possible to use jython classes from jav= a. More information on jython can be found on www.jython.org and in two fort= hcoming jython books, one from new riders (Jython for Java Programmers), should b= e out now and Essential Jython from O'Reilly, announced for spring. Cheerio, --=20 J.W...@sc... - Fon +4970719457-257 Fax-211 science+computing ag - Hagellocher Weg 71-75 - 72070 T=FCbingen Find computer scientists you respect and listen to their recommendations.= When they are still making the same recommendations a year later, look into it. (Paul D= ubois) |
From: <gre...@ne...> - 2002-01-11 01:17:27
|
Can anyone help me with an embedding question? I have an interface that I need to implement. When my method is called, I want to run an interactive interpreter (that part works fine) and be able to access some variables easily from within modules (I can't figure out how to do this). Here is the code I have: public class PythonDoclet implements Doclet { public static File outputDir; public static Map classesByName; public static List nodes; public static List loaders; public void generateDocumentation(File outputDir, Map classesByName, List nodes, List loaders) { InteractiveConsole interpreter = new InteractiveConsole(); PythonDoclet.outputDir = outputDir; PythonDoclet.classesByName = classesByName; PythonDoclet.nodes = nodes; PythonDoclet.loaders = loaders; interpreter.interact(); } } When the interpreter starts up, I can access PythonDoclet.outputDir (for instance) in the console and that works great. What I can't figure out is how to write a module that can access the same attribute. I have a module that looks like: import PythonDoclet print outputDir when I import it from the interactive console, I get this error: >>> import toXml Traceback (innermost last): File "<console>", line 1, in ? File "d:\home\greg\projects\dig\users\greg\ogredoc2docbook\.\toXml.py", line 4 , in ? NameError: outputDir It seems odd to me that I can access outputDir just fine when typing in the console, but not from a module. Any tips would be appreciated. tia - Greg -- __________________________________________________________________ Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/ Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/ |
From: Samuele P. <ped...@bl...> - 2002-01-11 00:57:56
|
[dman] > On Thu, Jan 10, 2002 at 04:16:14PM -0800, Brian Quinlan wrote: > | Paul Prescod wrote: > > | > Is that a problem? If the user specifies an encoding then you could > | > decode. If they don't, I would suggest to just do a no-op. Under what > | > circumstances would the current exception be more helpful? > | > | Because you are specifically looking for the exception to see if the > | string can be converted to a Unicode object using the default encoding? > > Is it supposed to be an error when trying to convert a unicode object > to a unicode object? I don't think so. I can convert an int to an > int. > > >>> x = u"\u20ac" > >>> x = unicode( u"\u20ac" ) > Traceback (innermost last): > File "<console>", line 1, in ? > UnicodeError: ascii decoding error: ordinal not in range(128) > >>> > > (I used assignment so I won't get the error of printing non-ascii > characters on an ascii display) > I start to think that Paul Prescod is right here. In CPython Python 2.1 (#15, Apr 16 2001, 18:25:49) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. >>> unicode(u"\xe9") u'\xe9' >>> while Jython 2.1 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> unicode(u"\xe9") Traceback (innermost last): File "<console>", line 1, in ? UnicodeError: ascii decoding error: ordinal not in range(128) >>> The question is: it is better to fail when CPython does not fails or not to fail when CPython fails and succeed when CPython succeeds. I'm maybe missing something subtle but I prefer the latter and so unicode without an encoding should be a nop. regards. |
From: dman <ds...@ri...> - 2002-01-11 00:43:15
|
On Thu, Jan 10, 2002 at 06:16:00PM -0500, Justin Sheehy wrote: | Hello, | | I am an experienced Python programmer, and I have written a few Java | programs before. I am making my first foray into Jython now. | | I need to interact with an already-existing Java system. | | What would be best is if I could create the following: | | 1 - A module named "Spam" | | 2 - Containing a class definition for the class "Spam". | | 3 - Where the class exposes several public static methods. | | Obviously, (3) is the problem. Class static methods aren't really | normal or usefully supported by Python. Rigth. | Is there some way that a Jython class can expose public static class | methods to Java modules? No. | Perhaps I should write the Python module and then write a Java adapter | to provide the proper interface? You can either create an instance of the class to invoke methods on, or make an adapter in java that hides the java<->python interface differences. -D -- Come to me, all you who are weary and burdened, and I will give you rest. Take my yoke upon you and learn from me, for I am gentle and humble in heart, and you will find rest for your souls. For my yoke is easy and my burden is light. Matthew 11:28-30 |
From: dman <ds...@ri...> - 2002-01-11 00:41:52
|
On Thu, Jan 10, 2002 at 04:16:14PM -0800, Brian Quinlan wrote: | Paul Prescod wrote: | > Is that a problem? If the user specifies an encoding then you could | > decode. If they don't, I would suggest to just do a no-op. Under what | > circumstances would the current exception be more helpful? | | Because you are specifically looking for the exception to see if the | string can be converted to a Unicode object using the default encoding? Is it supposed to be an error when trying to convert a unicode object to a unicode object? I don't think so. I can convert an int to an int. >>> x = u"\u20ac" >>> x = unicode( u"\u20ac" ) Traceback (innermost last): File "<console>", line 1, in ? UnicodeError: ascii decoding error: ordinal not in range(128) >>> (I used assignment so I won't get the error of printing non-ascii characters on an ascii display) -D -- He who finds a wife finds what is good and receives favor from the Lord. Proverbs 18:22 |
From: Brian Q. <br...@sw...> - 2002-01-11 00:14:38
|
Paul Prescod wrote: > Finn Bock wrote: > > > >... > > > > IMO, there is very little unification between java byte arrays and java > > strings and the methods that existed initially to convert between them > > have since been deprecated. That is A Good Thing because it clearly > > separates the obvious use of bytes and characters. > > You are right. What I meant was that "plain old strings" are Unicode in > Java. Byte arrays are not considered strings at all. And this is the real problem. Python strings are really just (unsigned) byte arrays. In any case, it problematic to map two different types (string and Unicode objects) to the same Java type. > > >then it should probably treat them all as Unicode strings, not as > > >8-bit. > > > > Then unicode() would be a no-op. It would just return the argument > > without doing anything. > > Is that a problem? If the user specifies an encoding then you could > decode. If they don't, I would suggest to just do a no-op. Under what > circumstances would the current exception be more helpful? Because you are specifically looking for the exception to see if the string can be converted to a Unicode object using the default encoding? Cheers, Brian |
From: Justin S. <ju...@ia...> - 2002-01-10 23:16:58
|
Hello, I am an experienced Python programmer, and I have written a few Java programs before. I am making my first foray into Jython now. I need to interact with an already-existing Java system. What would be best is if I could create the following: 1 - A module named "Spam" 2 - Containing a class definition for the class "Spam". 3 - Where the class exposes several public static methods. Obviously, (3) is the problem. Class static methods aren't really normal or usefully supported by Python. Is there some way that a Jython class can expose public static class methods to Java modules? Perhaps I should write the Python module and then write a Java adapter to provide the proper interface? I have searched the web and some of the archives, but did not see a definitive answer. If I looked in the wrong place, a pointer would be welcomed. Thanks. -Justin |
From: <kis...@na...> - 2002-01-10 23:05:11
|
The attached program ("FileRWTests.py") reads a data file (DataFile.ibi) and write back the lines skipping the blank and commnet lines, i.e. the lines starting with "/*" into a new data file (DataFile2.ibi). It is reading all the lines from the original lines, but not writing back all the valid lines. Wondering why it is not appending all the lines? Help. (See attached file: DataFile2.ibi)(See attached file: DataFile.ibi)(See attached file: FileRWTests.py) |
From: Paul P. <pa...@pr...> - 2002-01-10 22:49:55
|
Finn Bock wrote: > >... > > IMO, there is very little unification between java byte arrays and java > strings and the methods that existed initially to convert between them > have since been deprecated. That is A Good Thing because it clearly > separates the obvious use of bytes and characters. You are right. What I meant was that "plain old strings" are Unicode in Java. Byte arrays are not considered strings at all. > >then it should probably treat them all as Unicode strings, not as > >8-bit. > > Then unicode() would be a no-op. It would just return the argument > without doing anything. Is that a problem? If the user specifies an encoding then you could decode. If they don't, I would suggest to just do a no-op. Under what circumstances would the current exception be more helpful? Paul Prescod |
From: brian z. <bz...@zi...> - 2002-01-10 22:28:33
|
Justin, > PythonInterpreter interp=new PythonInterpreter(); > interp.exec("import jarray"); > interp.exec("x=jarray.array([1,2,3],'i')"); > PyArray x=(PyArray)interp.get("x"); > Class c=PyArray.char2class('i'); > Object o=x.__tojava__(c); > System.out.println(o.toString()); > The problem is you are asking PyArray to return an object of the type 'int' but PyArray's __tojava__ doesn't know anything about this type. Instead you have two options: (1) Ask for a generic Object. (2) Ask for the specific array type. If you choose to use (2), the following will create the correctly typed array: Class c = Array.newInstance(PyArray.char2class('i'), 0).getClass(); <note> I am not sure of another way to get an 'int[]' Class instance. Does anyone else? I'm surely missing something though this works. </note> > but it generates the result 'Error' which doesn't look > promising (why is no exception thrown?) You are really getting back the Py.NoConversion instance. You would see an exception if you tried to cast to some other type but since you don't you do not see an exception. In order to iterate the array dynamically I think you'll need to use the java.lang.reflect.Array class again to get the values, such as: for(int i=0; i<Array.getLength(o); i++) { System.out.println(Array.getInt(o, i)); } if you choose not statically cast the Object returned from PyArray.__tojava__(). If you choose to do it dynamically you might need some sort of switch in order to figure out what Array.getX() method to use or just use Array.get() to get an Object back. Hope this helps, brian |
From: <Jen...@i2...> - 2002-01-10 21:16:41
|
Hi, I'm new to both this list and to jython. I've searched through the recent messages from the list archives as well as www.jython.org, and I'm having trouble finding out how you're supposed to generate documentation from the embedded documentation strings (javadoc style, generating HTML or something similar). Can someone point me to a utility that does this? The general python documentation mentions something called pydoc, but it appears as though it's maybe specific to the C implementation? Jennifer |
From: Ype K. <yk...@xs...> - 2002-01-10 19:35:19
|
>In a Jython script, I import a Java class with: > > from jp import * > >unfortunately, inside "jp" is a method named "abs" which takes one >argument of a highly specialized type (non-python). After this import, if >I try to do: > >abs(3) > >I get an error that the argument could not be coerced to the "specialized >type" required by the "jp.abs()" method. > >While there are "workarounds" for this (like an explicit "from jp import >x,y,z"), I'd like to know if there is anything else I can do so that >script-writers won't inadvertantly run into this. > >I have spoken with the own of the library that "jp" is contained in about >simply changing the method names, but any other suggestions would be >welcomed. Write a wrapper module jpwrap.py: from jp import * jpabs = abs del abs and import this as: from jpwrap import * >Thanks. My pleasure. However, it is considered bad style to use from ... import * outside an interactive session. Explicit is better than implicit. This works also: import jp jp.abs(someArgWithSpecializedType) When your module name is very long, use eg.: import moduleWithLongName as lNamMod When the dot operator gets too expensive replace it by a local variable in the loop. Good luck, Ype -- |
From: <bc...@wo...> - 2002-01-10 19:26:37
|
[Paul Prescod] >Brian Quinlan reported this strange result to me: > >Jython 2.1 on java1.3.1_02 (JIT: null) >Type "copyright", "credits" or "license" for more information. >>>> x=u'\x81' >>>> unicode(x) >Traceback (innermost last): > File "<console>", line 1, in ? >UnicodeError: ascii decoding error: ordinal not in range(128) In CPython the unicode() builtin function will either. - decodes a byte string - returns a unicode argument unmodified. In jython there is no difference between the strings u"\x81" and "\x81". So we can only do one of these two things. >If Jython is going to unify 8-bit strings and Unicode strings (as Java >does) IMO, there is very little unification between java byte arrays and java strings and the methods that existed initially to convert between them have since been deprecated. That is A Good Thing because it clearly separates the obvious use of bytes and characters. >then it should probably treat them all as Unicode strings, not as >8-bit. Then unicode() would be a no-op. It would just return the argument without doing anything. It is unfortunate that there are such differences between CPython and Jython, but it is a natural consequence of our design where we decided to work without a byte string type. regards, finn |
From: Paul P. <pa...@pr...> - 2002-01-10 17:47:57
|
Brian Quinlan reported this strange result to me: Jython 2.1 on java1.3.1_02 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> x=u'\x81' >>> unicode(x) Traceback (innermost last): File "<console>", line 1, in ? UnicodeError: ascii decoding error: ordinal not in range(128) If Jython is going to unify 8-bit strings and Unicode strings (as Java does) then it should probably treat them all as Unicode strings, not as 8-bit. Paul Prescod |
From: Justin W. <Jus...@mo...> - 2002-01-10 17:41:24
|
Hi, I am using jython embedded in java, specifically the PythonInterpreter class. I have a java object containing a series of member variables. I want to pass it into the interpreter and generate an array based on those member variables and a user-defined jython script. I then want to take the resulting array and drop out of the interpreter / back into java. I can pass the object into the interpreter and generate the result array no problem. The difficulty seems to be getting out of the interpreter. In the docs, the only way out I can see is via a PyObject object (from PythonInterpreter.get(String _name)) - I can have my result array either as a list or as a jarray, export it using this method and then re-cast to a PyArray. But how then do I convert to a java object or array ? I thought the following looked promising, PythonInterpreter interp=new PythonInterpreter(); interp.exec("import jarray"); interp.exec("x=jarray.array([1,2,3],'i')"); PyArray x=(PyArray)interp.get("x"); Class c=PyArray.char2class('i'); Object o=x.__tojava__(c); System.out.println(o.toString()); but it generates the result 'Error' which doesn't look promising (why is no exception thrown?) Thanks! |