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: Samuele P. <pe...@in...> - 2002-03-19 16:48:11
|
[me on synchronize built-in module] obviously that was the direct translation, otherwise you can use the synchronization primitives of python threading.py: http://www.python.org/doc/2.1/lib/module-threading.html Or look at this Ype Kigma's post: http://aspn.activestate.com/ASPN/Mail/Message/828840 regards. |
From: Samuele P. <pe...@in...> - 2002-03-19 16:32:53
|
From: Stephen Naicken <ste...@co...> > I'm porting some Java code to Jython. How woould I write a synchronised > block? > > synchronized(some_object){ > //code > } > > Thanks > > Stephen For methods: import synchronize class C: def m(self): ... stuff ... m = synchronize.make_synchronized(m) For you specific idiom: you should put code in local/global function or use lambda and from synchornize import apply_synchronized def code(): ... # your code ... apply_synchronized(some_object,code,()) # apply_synchronized(some_object,lambda: code,()) regards. |
From: Brad C. <bc...@vi...> - 2002-03-19 16:17:08
|
I've just begun experimenting with jpython (just today). Hope to use it to replace velocity as the teacher-programmable component of the interactive learning environment at http://virtualschool.edu/jile. My first problem is that tutorial chapter on strings isn't working right (on Linux 7.0 Redhat) >>> "Hello world" "Hello world" >>> "Hello\ Syntax error: LexicalScanner Encountered <EOF> after \ This one is critical and preventing me from exploring deeper. Second problem is that command history isn't working. readline is definitely installed but isn't being recognized by the installer. Can someone please help? Sorry if these are faqs; I've not made it through all the docs yet. -- Brad Cox, PhD; bc...@vi... 703 361 4751 o For industrial age goods there were checks and credit cards. For everything else there is http://virtualschool.edu/mybank o Java Interactive Learning Environment http://virtualschool.edu/jile o Java Web Application Architecture: http://virtualschool.edu/jwaa |
From: Stephen N. <ste...@co...> - 2002-03-19 15:30:04
|
I'm porting some Java code to Jython. How woould I write a synchronised block? synchronized(some_object){ //code } Thanks Stephen |
From: Boris H. <Bor...@ma...> - 2002-03-19 13:24:24
|
Hi, I am working on a Java Applet under IE 5.5 which interacts with a plugin. The data come from a real-time platform via a python 1.5.2 library (pyd extension) and I make the platform communicate with the Applet via a TCP/IP connection. I have just been told about the Jython language (I have installed the 2.1 version) and it seems to be one solution for my problem. Could anyone tell me how to make it work out ? I tried to compile the pyd file into a real Java class using jythonc but it doesn't work (the library is not py). Would it be possible to use this library in any ways to prevent me from developping one standalone program in Python 1.5.2 which will just send the data to the Applet ? TIA, Boris -- Sinceres salutations, Boris HUART [mailto:bor...@ma...] ____________________________________________________________________ The MathWorks Consulting Tel : 01 55 64 06 63 Fax : 01 55 64 06 64 20 rue Troyon Email : mailto:con...@ma... 92316 Sevres Cedex, France Web : http://www.mathworks.fr ____________________________________________________________________ |
From: <da...@cr...> - 2002-03-19 12:26:18
|
Hi, Just been browsing through jython docs on some other matter when I saw the statement on the differences page at jython.org: 'The following are highly unlikely any time soon --win32com and Tkinter.' Has anyone come across JaWin? Its a wrapper for COM components that might make it fairly easy to do a win32com for jython. Not something for me, I'm mainly a linux user anyway these days, but thought it worth dropping this onto the list before I wander on... Cheers, Dave |
From: <pt...@pt...> - 2002-03-18 22:17:37
|
<HTML> <HEAD> <META NAME=3D"GENERATOR" Content=3D"Microsoft DHTML Editing Control"> <TITLE></TITLE> </HEAD> <BODY> <P> </P> </BODY> </HTML> |
From: BillWorker 2. <bil...@in...> - 2002-03-18 04:57:01
|
Okay, I just have modified your code to include a few more classes. If you run the script you will see that only for PyClass5, the one that inherits from java.lang.Object, the JList shows a proper string in the list. Ashish ---------- code --------- import java import javax.swing as swing class PyClass1: pass class PyClass2: def __repr__(self): return 'PyClass2' class PyClass3: def __str__(self): return 'PyClass3' class PyClass4: def toString(self): return 'PyClass4' class PyClass5(java.lang.Object): def toString(self): return 'PyClass5' class TestModel(swing.AbstractListModel): def __init__(self): self.classList = [PyClass1(), PyClass2(), PyClass3(), PyClass4(), PyClass5()] def getElementAt(self, i): return self.classList[i] def getSize(self): return len(self.classList) frame = swing.JFrame('test') jlist = swing.JList(TestModel()) frame.contentPane.add(jlist) frame.pack() frame.visible = 1 |
From: Ype K. <yk...@xs...> - 2002-03-16 22:17:58
|
Michel, >Hi! > >I have a handful of .jar files that contain classes I'm interested in >using from Jython. They reside in a directory called 'C:\foo'. The >only .jar file I'm interested in is called ldap.jar, but there are >also a half-dozen .jar files that ldap.jar depends on. > >So my question is, how can I import the classes from ldap.jar? I >tried simply running jython from the folder that contained all the >..jar files but 'import ldap' didn't fly. I tried adding the .jar >files to the -classpath and the same import statement failed again. >I'm sure this is a simple thing and I'm just not waving the dead >chicken in quite the right way. You don't need to import the jar itself. For example with classes.zip on the class path you can import java # just another package in classes.zip Would that be simple enough? Ype -- |
From: Samuele P. <pe...@in...> - 2002-03-16 19:19:08
|
From: Syver Enstad <syv...@on...> > > When? Are there any plans? > The developers plan to do Jython 2.2. It should include the new CPython 2.2 features, maybe new Java/Jython integration improvements, especially wrt to import. About when? no concrete answer to give, it's up to developers' (time) disponibility. More working developers are there, the sooner it will be. Contributions are always welcome :-). i) bugfixes are always a good thing, and a good way to start contributing. ii) the design of the implementation of complex features should probably be discussed before on jython-dev. iii) some rework could be required on a patch before it is accepted. iv) it may happen that a patch (especially for new features or non critical bugs) is "rejected" because it would be better - on the long run - to refactor a part of the codebase than simply patch it. Either the proponent does the refactoring after discussion, or he should accept that the functionality/fix will be incorparted only when someone else has time to do the refactoring. There are exceptions but Entropy Kills. regards. |
From: Brian Z. <bri...@ya...> - 2002-03-16 17:39:08
|
My point of view: jython servlet is equivalent to model 1 JSP - not much difference embedding code in markup or markup in code. And model 2 JSP is still not clean separation: with logic/iteration tag, aren't you in fact writing code again in markup? - not mentioning all the extra tags no standard browser can display. If you want a total separation of markup and code even better than model 2 JSP(tag lib), an excellent choice is XMLC from xmlc.enhydra.org. Unlike other template solution, you don't need to have a special purpose language embedded in HTML(or XML/WML), you can just use whatever fancy authoring tool you like, and _keep_ using your favorite tool. The page with id attributes then is compiled into .class file representing DOM. Yes DOM manipulation is tedious in Java, but that's where jython shines! XMLC itself does not address MVC, but barracuda.enhydra.org covers it. If all you need is struts-like MVC, it shouldn't be difficult to write or port one yourself. You can even embed multiple jython interpreters so not only your "view" is using jython servlet, but also the "control" event handler, even the "model". The only downsides: Lutris is tiny compared to Sun; and it's not certain how committed they're to open source; some performance overhead especially with jython. -Brian ----- Original Message ----- From: "rbill" <rb...@vi...> To: "BillWorker 2i" <bil...@in...> Cc: <jyt...@li...> Sent: Friday, March 15, 2002 5:25 PM Subject: Re: [Jython-users] idea: custom tag library and jython > On Fri, 15 Mar 2002, BillWorker 2i wrote: > > Just wondering if it is a good idea! > > > > How about developing a custom tag for web apps. One that takes jython > > scriplet in its body. The request, response, session etc would be available > > as explicit objects. The tag could embed a jython interpreter and execute > > the given code. How I wish jsp were jython server pages! > > BSF makes this pretty easy, but it's not ideal. Mainly because you ruin > separation of concerns by plugging exec/evals into a jsp mess. While I > originally liked this idea, it turns out to be a maintenance mess! I've > been away from it a bit so I have only a little progress here, but a > better plan is to support jython classes right in MVC rigs like velocity > (turbine), webmacro, freemarker (maybe struts, but I don't know much about > it). This way there's not really code in templates, and Jython classes > handle non-visual grunt work. This does more for web development with > Jython than an exec/eval in jsp. > > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |
From: Syver E. <syv...@on...> - 2002-03-16 17:12:47
|
When? Are there any plans? -- Vennlig hilsen Syver Enstad |
From: Syver E. <syv...@on...> - 2002-03-16 16:42:06
|
"Brad Clements" <bk...@mu...> writes: > On 15 Mar 2002 at 14:29, Syver Enstad wrote: > > A minor quibble, Jython is strongly typed not typeless. But it is > > dynamically and not statically typed (but you already knew that). I > > Good point. It is an important distinction. Yeah, not least because there are some people out there that have made up their mind that strong typing is good, weak typing is bad. They tend to look at that in terms of static/dynamic typing, so it's nice to be able to whack them on the head with: python is indeed strongly typed, it's just that it is dynamically typed :-). -- Vennlig hilsen Syver Enstad |
From: Anthony E. <ae...@si...> - 2002-03-16 12:37:37
|
FWIW, the JPublish framework supports using Jython for implementing actions (small pieces of code which are triggered when a URL is requested) through BSF and allows the Jython scripts to place objects into the Velocity context. All of the example code uses Python for the actions (I am a big fan of Python, and especially Jython). JPublish is at: http://www.jpublish.org/ Personally I am looking forward to the day when I can ditch all of my JSP code. I am really tired of having HTML and code mixed together and JSP, while you can do MVC, it is just to easy to put code in the page. Sincerely, Anthony Eden > -----Original Message----- > From: jyt...@li... > [mailto:jyt...@li...] On Behalf Of rbill > Sent: Friday, March 15, 2002 8:25 PM > To: BillWorker 2i > Cc: jyt...@li... > Subject: Re: [Jython-users] idea: custom tag library and jython > > > On Fri, 15 Mar 2002, BillWorker 2i wrote: > > Just wondering if it is a good idea! > > > > How about developing a custom tag for web apps. One that > takes jython > > scriplet in its body. The request, response, session etc would be > > available as explicit objects. The tag could embed a jython > > interpreter and execute the given code. How I wish jsp were jython > > server pages! > > BSF makes this pretty easy, but it's not ideal. Mainly > because you ruin > separation of concerns by plugging exec/evals into a jsp > mess. While I > originally liked this idea, it turns out to be a maintenance > mess! I've > been away from it a bit so I have only a little progress here, but a > better plan is to support jython classes right in MVC rigs > like velocity > (turbine), webmacro, freemarker (maybe struts, but I don't > know much about > it). This way there's not really code in templates, and > Jython classes > handle non-visual grunt work. This does more for web > development with > Jython than an exec/eval in jsp. > > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |
From: rbill <rb...@vi...> - 2002-03-16 01:26:05
|
On Fri, 15 Mar 2002, BillWorker 2i wrote: > Just wondering if it is a good idea! > > How about developing a custom tag for web apps. One that takes jython > scriplet in its body. The request, response, session etc would be available > as explicit objects. The tag could embed a jython interpreter and execute > the given code. How I wish jsp were jython server pages! BSF makes this pretty easy, but it's not ideal. Mainly because you ruin separation of concerns by plugging exec/evals into a jsp mess. While I originally liked this idea, it turns out to be a maintenance mess! I've been away from it a bit so I have only a little progress here, but a better plan is to support jython classes right in MVC rigs like velocity (turbine), webmacro, freemarker (maybe struts, but I don't know much about it). This way there's not really code in templates, and Jython classes handle non-visual grunt work. This does more for web development with Jython than an exec/eval in jsp. |
From: Brad C. <bk...@mu...> - 2002-03-15 19:07:01
|
On 15 Mar 2002 at 18:57, Dan...@at... wrote: > Brian Zhou <bri...@ya...> mentioned PythonCE in > a recent post. I thought that it was a defunct effort. > Is this not true? Can anyone provide a pointer? > Thanks http://www.murkworks.com/Research/Python/PocketPCPython/Overview I'll be revisiting this when I get back from Brainshare conference. I really want to get Pythoncard running on PPC. (needs wxWindows) Brad Clements, bk...@mu... (315)268-1000 http://www.murkworks.com (315)268-9812 Fax AOL-IM: BKClements |
From: <Dan...@at...> - 2002-03-15 18:57:59
|
Brian Zhou <bri...@ya...> mentioned PythonCE in a recent post. I thought that it was a defunct effort. Is this not true? Can anyone provide a pointer? Thanks -- _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ Dana Moore - BBN Technologies 703.284.4740 (W) 240.350.4196 (M) dan...@at... _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ > Hi Brad, > > For 1 and 2, http://www.python.org/doc/essays/ppt/lwnyc2002/intro22.ppt > seems very good. > > As to the example, IMO interactively explore some java API would open eyes > for VB and Perl programmers. Features like built-in list, dictionary, > slicing probably are easier to demonstrate than polymorphic dynamic OO. Here > are some examples I often use: > > 1) java.vm.version > > >>> from java.lang import System > >>> dir(System) > ['arraycopy', 'currentTimeMillis', 'err', 'exit', 'gc', 'getProperties', > 'getProperty', 'getSecurityManager', 'getenv', 'identityHashCode', 'in', > 'load', 'loadLibrary', 'mapLibraryName', 'out', 'runFinalization', > 'runFinalizersOnExit', 'setErr', 'setIn', 'setOut', 'setProperties', > 'setProperty', 'setSecurityManager'] > >>> props = System.getProperties() > >>> props.__class__ > <jclass java.util.Properties at 7576227> > >>> props.__class__.__bases__ > (<jclass java.util.Hashtable at 3325456>,) > >>> for k in props.keys(): > ... if k.startswith('java.vm.'): > ... print k > ... > java.vm.version > java.vm.vendor > java.vm.name > java.vm.specification.name > java.vm.specification.vendor > java.vm.specification.version > java.vm.info > >>> props['java.vm.version'] > '1.3.1_02-b02' > > 2) exercise from SICP book in python > >>> def subsets(aList): > ... if [] == aList: return [ [] ] > ... else: > ... rest = subsets(aList[1:]) > ... return rest + [ [aList[0]] + x for x in rest ] > ... > >>> subsets([1,2,3]) > [[], [3], [2], [2, 3], [1], [1, 3], [1, 2], [1, 2, 3]] > > 3) swing calculator (put it in swingCalc.py) > ############################################ > # evaluation runs a full expression all at > # once using the Python eval() built-in-- > # interpreter is present at run-time > ############################################ > > from java import awt # get access to Java class libraries > from pawt import swing # they look like Python modules here > > labels = ['0', '1', '2', '+', # labels for calculator buttons > '3', '4', '5', '-', # will be used for a 4x4 grid > '6', '7', '8', '*', > '9', '.', '=', '/' ] > > keys = swing.JPanel(awt.GridLayout(4, 4)) # do Java class library magic > display = swing.JTextField() # Python data auto-mapped to > Java > > def push(event): # callback for regular keys > display.replaceSelection(event.actionCommand) > > def enter(event): # callback for the '=' key > display.text = str(eval(display.text)) # use Python eval() to run > expr > display.selectAll() > > for label in labels: # build up button widget grid > key = swing.JButton(label) # on press, invoke Python > funcs > if label == '=': > key.actionPerformed = enter > else: > key.actionPerformed = push > keys.add(key) > > panel = swing.JPanel(awt.BorderLayout()) # make a swing panel > panel.add("North", display) # text plus key grid in middle > panel.add("Center", keys) > swing.test(panel) # start in a GUI viewer > > > BTW, Thank you for the excellent PythonCE work, I really enjoy using it! > > -Brian > > ----- Original Message ----- > From: "Brad Clements" <bk...@mu...> > To: <jyt...@li...> > Sent: Thursday, March 14, 2002 7:23 PM > Subject: [Jython-users] Looking for Jython promo materials > > > > Next week I need to give a one hour presentation at Novell's Brainshare > titled: > > > > "Rapid Application Development with Jython". > > > > I'll be demo'ing Jedit, JythonInterpreter (plugin), JinSitu and of course > Jython, on Win32 > > and NetWare Systems. > > > > I have a simple Beans based application that I'll be showing, but I'm > looking for some > > other things: > > > > 1. Quick intro to the Python Language (10 minutes) > > > > 2. Perhaps a Power Point slide show for item 1 > > > > 3. Quick examples that I can type interactively that demonstrate the power > of the > > interpreted, typeless nature of Jython. > > > > I'm aware of what's available at python.org and jython.org, but if you > have any other > > recommendations I'd appreciate it. > > > > My audience will be in-experienced VB'ers/Perlers.. And experienced Java > developers. > > > > Thanks for any suggestions, > > > > > > > > > > Brad Clements, bk...@mu... (315)268-1000 > > http://www.murkworks.com (315)268-9812 Fax > > AOL-IM: BKClements > > > > > > _______________________________________________ > > Jython-users mailing list > > Jyt...@li... > > https://lists.sourceforge.net/lists/listinfo/jython-users > > > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Brian Z. <bri...@ya...> - 2002-03-15 18:13:03
|
Hi Brad, For 1 and 2, http://www.python.org/doc/essays/ppt/lwnyc2002/intro22.ppt seems very good. As to the example, IMO interactively explore some java API would open eyes for VB and Perl programmers. Features like built-in list, dictionary, slicing probably are easier to demonstrate than polymorphic dynamic OO. Here are some examples I often use: 1) java.vm.version >>> from java.lang import System >>> dir(System) ['arraycopy', 'currentTimeMillis', 'err', 'exit', 'gc', 'getProperties', 'getProperty', 'getSecurityManager', 'getenv', 'identityHashCode', 'in', 'load', 'loadLibrary', 'mapLibraryName', 'out', 'runFinalization', 'runFinalizersOnExit', 'setErr', 'setIn', 'setOut', 'setProperties', 'setProperty', 'setSecurityManager'] >>> props = System.getProperties() >>> props.__class__ <jclass java.util.Properties at 7576227> >>> props.__class__.__bases__ (<jclass java.util.Hashtable at 3325456>,) >>> for k in props.keys(): ... if k.startswith('java.vm.'): ... print k ... java.vm.version java.vm.vendor java.vm.name java.vm.specification.name java.vm.specification.vendor java.vm.specification.version java.vm.info >>> props['java.vm.version'] '1.3.1_02-b02' 2) exercise from SICP book in python >>> def subsets(aList): ... if [] == aList: return [ [] ] ... else: ... rest = subsets(aList[1:]) ... return rest + [ [aList[0]] + x for x in rest ] ... >>> subsets([1,2,3]) [[], [3], [2], [2, 3], [1], [1, 3], [1, 2], [1, 2, 3]] 3) swing calculator (put it in swingCalc.py) ############################################ # evaluation runs a full expression all at # once using the Python eval() built-in-- # interpreter is present at run-time ############################################ from java import awt # get access to Java class libraries from pawt import swing # they look like Python modules here labels = ['0', '1', '2', '+', # labels for calculator buttons '3', '4', '5', '-', # will be used for a 4x4 grid '6', '7', '8', '*', '9', '.', '=', '/' ] keys = swing.JPanel(awt.GridLayout(4, 4)) # do Java class library magic display = swing.JTextField() # Python data auto-mapped to Java def push(event): # callback for regular keys display.replaceSelection(event.actionCommand) def enter(event): # callback for the '=' key display.text = str(eval(display.text)) # use Python eval() to run expr display.selectAll() for label in labels: # build up button widget grid key = swing.JButton(label) # on press, invoke Python funcs if label == '=': key.actionPerformed = enter else: key.actionPerformed = push keys.add(key) panel = swing.JPanel(awt.BorderLayout()) # make a swing panel panel.add("North", display) # text plus key grid in middle panel.add("Center", keys) swing.test(panel) # start in a GUI viewer BTW, Thank you for the excellent PythonCE work, I really enjoy using it! -Brian ----- Original Message ----- From: "Brad Clements" <bk...@mu...> To: <jyt...@li...> Sent: Thursday, March 14, 2002 7:23 PM Subject: [Jython-users] Looking for Jython promo materials > Next week I need to give a one hour presentation at Novell's Brainshare titled: > > "Rapid Application Development with Jython". > > I'll be demo'ing Jedit, JythonInterpreter (plugin), JinSitu and of course Jython, on Win32 > and NetWare Systems. > > I have a simple Beans based application that I'll be showing, but I'm looking for some > other things: > > 1. Quick intro to the Python Language (10 minutes) > > 2. Perhaps a Power Point slide show for item 1 > > 3. Quick examples that I can type interactively that demonstrate the power of the > interpreted, typeless nature of Jython. > > I'm aware of what's available at python.org and jython.org, but if you have any other > recommendations I'd appreciate it. > > My audience will be in-experienced VB'ers/Perlers.. And experienced Java developers. > > Thanks for any suggestions, > > > > > Brad Clements, bk...@mu... (315)268-1000 > http://www.murkworks.com (315)268-9812 Fax > AOL-IM: BKClements > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |
From: <don...@kc...> - 2002-03-15 16:09:07
|
I will be out of the office starting 03/14/2002 and will not return until 03/18/2002. |
From: Jeff E. <je...@ad...> - 2002-03-15 15:55:10
|
This works for me. No explicit java.lang.Objects in sight. from javax.swing import * class PythonClass: pass pythonInstance = PythonClass() pythonString = 'foo' pythonInt = 3 l = [pythonInstance, pythonString, pythonInt] class MyModel(AbstractListModel): def getElementAt(self, i): return l[i] def getSize(self): return len(l) model = MyModel() jlist = JList(model) frame = JFrame() frame.contentPane.add(jlist) frame.setSize(100,300) frame.show() Perhaps you should post an example that shows your problem. BillWorker 2i wrote: > Let me explain myself! > > In Java if I were to extend AbstractListModel and use an array internalArray > to hold my data internally, then for getElementAt() I could do > internalArray[i]. The object that I get from the array does not need to be > converted to java.lang.Object as it ALWAYS inherits from java.lang.Object > > However, in Jython I have to either > i. ensure that the object that I get from the array (list) is an instance of > java.lang.Object or > ii. wrap the Python object into a wrapper class that inherits from > java.lang.Object > > This is not obivous to a new Jython programmer who has come from Java! > > Ashish > > > > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |
From: Stephen N. <ste...@co...> - 2002-03-15 15:43:23
|
I intend to code a Graphical User Interface using Jython. I would like to structure the GUI class design using Object Oriented priniciples. I have looked at some design patterns, inparticular Model-View-Controller (MVC) and HMVC. Do any of you have any recommendation as to how to structure the GUI? Thanks Stephen |
From: <cl...@cl...> - 2002-03-15 15:34:27
|
<html> <head> <title>=B2=C7=B2=C7=B2=C7=B2=C7=C2=A5!!! =C4=AE=B6=F3=C7=DA=B5=E5=C6=F9=C0= =CC =B2=C7=C2=A5 =2E=2E=2E=2E</title> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Deuc-kr">= </head> <body bgcolor=3D"#ffffff" text=3D"#000000" leftmargin=3D"0" topmargin=3D"0= " marginwidth=3D"0" marginheight=3D"0"> <table width=3D"630" border=3D"0" cellspacing=3D"0" cellpadding=3D"5" bgcolor=3D"#ffffff"> <tr> =20 <td><font color=3Dred size=3D-1> * =BA=BB =B8=DE=C0=CF=C0=BA =C1=A4=BA= =B8=C5=EB=BD=C5=BA=CE =B1=C7=B0=ED=BB=E7=C7=D7=BF=A1 =C0=C7=B0=C5(=B1=A4=B0=ED)=C0=D3=C0=BB =B9=E0=C8=FC=B4=CF=B4=D9=2E =C7=E3=B6= =F4=BE=F8=C0=CC =C8=AB=BA=B8=B8=DE=C0=CF=C0=BB=20 =BA=B8=B3=BB=B5=E5=B7=C1 =C1=CB=BC=DB=C7=D5=B4=CF=B4=D9=2E<br> =B1=CD=C7=CF=C0=C7 E-Mail =C0=BA =B0=D4=BD=C3=C6=C7 =B5=EE= =C0=CE=C5=CD=B3=DD =BB=F3=BF=A1=BC=AD =BE=CB=B0=D4 =B5=C7=BE=FA=C0=B8=B8=E7= , E-Mail =C0=BB =C1=A6=BF=DC=C7=D1 =BE=EE=B6=B0=C7=D1 =C1=A4=BA=B8=B5=B5 =BE= =CB=C1=F6=20 =B8=F8=C7=D4=C0=BB<br> =B9=E0=C8=FC=B4=CF=B4=D9=2E <br><br></font><font color=3D= "#0066ff" size=3D"-1"> =BC=F6=BD=C5=B0=C5=BA=CE=B8=A6 =BF=F8=C7=CF=BD=C3=B8= =E9=20 =BE=C6=B7=A1=BF=A1=BC=AD =BC=F6=BD=C5=B0=C5=BA=CE =C7=D8 =C1=D6=BC=BC= =BF=E4=2E=B0=C5=BA=CE=C7=CF=BD=C5 =BA=D0=B5=E9=BF=A1=B0=D4=B4=C2 =B4=D9=BD= =C3=B4=C2 =BA=B8=B3=BB=C1=F6 =BE=CA=C0=BB =B0=CD=C0=D4=B4=CF=B4=D9=2E<br> =C1=A4=BA=B8=B8=A6 =BF=F8=C4=A1= =BE=CA=B4=C2 =BA=D0=B2=B2=B4=C2 =B4=EB=B4=DC=C8=F7 =C1=CB=BC=DB =C7=D5=B4=CF=B4=D9=2E</font></td> </tr> =09=09<tr> =09=09<td> =09=09<table width=3D"40" border=3D"0" cellspacing=3D"0" cellpadding=3D"0"= > <tr>=20 <td width=3D"48%"><img src=3D"http://www=2Eclickij=2Ecom/mail/img/img3_17_00=2Egif" width=3D"325"= height=3D"164"></td> <td width=3D"5%"><img src=3D"http://www=2Eclickij=2Ecom/mail/img/img3_17_03=2Egif" width=3D"175"= height=3D"164"></td> </tr> <tr>=20 <td width=3D"48%"><img src=3D"http://www=2Eclickij=2Ecom/mail/img/img3_17_01=2Egif" width=3D"325"= height=3D"146"></td> <td width=3D"5%"><img src=3D"http://www=2Eclickij=2Ecom/mail/img/img3_17_06=2Egif" width=3D"176"= height=3D"146"></td> </tr> <tr>=20 <td width=3D"48%" height=3D"140"><img src=3D"http://www=2Eclickij=2Ecom/mail/img/img3_17_07=2Egif" width=3D"325"= height=3D"153"></td> <td width=3D"5%" height=3D"140"><img src=3D"http://www=2Eclickij=2Ecom/mail/img/img3_17_09=2Egif" width=3D"176"= height=3D"153"></td> </tr> <tr>=20 <td width=3D"48%"><img src=3D"http://www=2Eclickij=2Ecom/mail/img/img3_17_10=2Egif" width=3D"325"= height=3D"157"></td> <td width=3D"47%"><img src=3D"http://www=2Eclickij=2Ecom/mail/img/img3_17_12=2Egif" width=3D"176"= height=3D"157"></td> </tr> <tr>=20 <td width=3D"48%"> </td> <td width=3D"5%"> </td> <td width=3D"47%"> </td> </tr> <tr>=20 <td width=3D"48%"> </td> <td width=3D"5%"><a href=3D"http://www=2Eclickij=2Ecom" target=3D'_bla= nk'><img src=3D"http://www=2Eclickij=2Ecom/mail/img/img3_17_15=2Egif" width=3D"176"= height=3D"30" border=3D0></a></td> <td width=3D"47%"> </td> </tr> <tr>=20 <td width=3D"48%"> </td> <td width=3D"5%"> </td> <td width=3D"47%"> </td> </tr> <tr>=20 <td colspan=3D3>=20 =09<div align=3D"center"><A target=3D_blank href=3D"http://www=2Eclickij=2Ecom/mail/receiver=2Ehtml"><font color=3D"re= d" size=3D"2" face=3D"=B5=B8=BF=F2">=BC=F6=BD=C5=B0=C5=BA=CE</font></A>=20 </div> </td> </tr> </table> </td> </tr> </table> </body> </html> |
From: Syver E. <syv...@on...> - 2002-03-15 13:30:45
|
"Brad Clements" <bk...@mu...> writes: > Next week I need to give a one hour presentation at Novell's > Brainshare titled: > > "Rapid Application Development with Jython". > 3. Quick examples that I can type interactively that demonstrate the > power of the interpreted, typeless nature of Jython. I always found Jython excellent for investigating unfamiliar API's. Maybe you can use some JAVA api for an example. Maybe some JDBC stuff? A minor quibble, Jython is strongly typed not typeless. But it is dynamically and not statically typed (but you already knew that). I think that (J/P)ython is very different from languages were all the objects are autocasting themselves in that you aren't aware of what types are really used before something goes Ka-Boom, Jscript and VBScript springs to mind. -- Vennlig hilsen Syver Enstad |
From: Syver E. <syv...@on...> - 2002-03-15 13:21:03
|
"BillWorker 2i" <bil...@in...> writes: > Just wondering if it is a good idea! > > How about developing a custom tag for web apps. One that takes > jython scriplet in its body. The request, response, session etc > would be available as explicit objects. The tag could embed a jython > interpreter and execute the given code. It is in fact such a good idea that it has already been done. Go to Robert Bill's jython for java programmers, he has links to all the stuff there and his book contains an example on how to make it work. -- Vennlig hilsen Syver Enstad |
From: Michel P. <mi...@di...> - 2002-03-15 12:00:26
|
Hi! I have a handful of .jar files that contain classes I'm interested in using from Jython. They reside in a directory called 'C:\foo'. The only .jar file I'm interested in is called ldap.jar, but there are also a half-dozen .jar files that ldap.jar depends on. So my question is, how can I import the classes from ldap.jar? I tried simply running jython from the folder that contained all the ..jar files but 'import ldap' didn't fly. I tried adding the .jar files to the -classpath and the same import statement failed again. I'm sure this is a simple thing and I'm just not waving the dead chicken in quite the right way. Many thanks for anyone who can give me a tip! -Michel |