From: Phil S. <psu...@es...> - 2001-09-21 16:14:39
|
os to the os.chdir() thing, check out http://sourceforge.net/projects/jnios. A few people have been talking about it recently on the list. I tried it out, it works very well. It uses JNI so it will not be an option in some cases. pipe() doesn't work and it may not work under linux, though I'm hoping a good linux person may solve that. To use jnios, extract it and do something like this: d:\projects>set path=d:\tools\jnios-1.7;%path% d:\projects>set classpath=d:\tools\jnios-1.7\jnios.jar d:\projects>jython -Dpython.path=d:\tools\jnios-1.7 Jython 2.1a3 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> from jnios import os >>> os.chdir(r'\temp') >>> os.getcwd() 'd:\\temp' Note that the jnios readme has instructions for making jnios your default os package, obviating the need for the from jnios import os statement. As to popitem(): 2.1a3 supports it. But note that it does not show up in the dir()?! d:\projects>jython -Dpython.path=d:\tools\jnios-1.7 Jython 2.1a3 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> a = {1:2, 3:4} >>> dir(a) ['clear', 'copy', 'get', 'has_key', 'items', 'keys', 'setdefault', 'update', 'values'] >>> a.popitem() (3, 4) >>> d:\projects>python Python 2.1 (#15, Apr 16 2001, 18:25:49) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. >>> a = {1:2, 3:4, 5:6} >>> dir(a) ['clear', 'copy', 'get', 'has_key', 'items', 'keys', 'popitem', 'setdefault', 'update', values'] >>> IMHO jython 2.1a3 is much better than Jython 2.0. Like you I stayed away from it for a while because I prefer to avoid alpha software, but it seems at least as stable as 2.0 to me and there are fewer python/jython incompatibilities. -----Original Message----- From: Mark Robinson [mailto:blo...@ho...] Sent: Friday, September 21, 2001 11:18 AM To: jyt...@li... Subject: [Jython-users] no popitem in jython 2.0 I am currently in the process of converting an application I wrote in python to jython, so I can use swing for a GUI. As far as GUI side goes so, excellent stuff, consider my socks impressed off my feet. However, there seem to be a number of python functionality, that is missing in jython. Earlier today I realised I could no longer use the os.chdir() method, and I have just noticed that popitem() is not supported for dictionary objects (at least in version 2.0, which was the latest stable release as far as I can see) Can anyone tell me if this is just a work in progress situation, and these features are just waiting to added or if they haven't been added for some particular reason. Secondly, can anyone tell me if there are any other issues I may have with code breakage moving from python2.1 to jython2.0? Please don't get the wrong idea here, I think jython is wonderful to use, and has saved me hours of work already ;), I am just trying to evaluate just how much the differences are going to affect me. cheers Blobby _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users |