From: Vernon C. <ver...@gm...> - 2011-03-16 00:29:33
|
Hello, all. You don't know me, I just signed up to the group. I am being required to learn Java for a college class [Bill Gates and I dropped out the same year & I am now back] and I added the Python support package to NetBeans -- since Python has been my language of choice for several years. I was very impressed with Jython 2.5. I dredged up an old program which I wrote several years ago as an adjunct to a Java desktop application. The Python implementation I was using had gone away (I had "borrowed" the Python from inside OpenOffice) so my little application had quit working. It seemed that simply running my old code in Jython would do the trick. It tested fine in NetBeans. Then I started trying to learn how to run it from a shortcut. Yipes! A few days ago a discussion cropped on the IronPython discussion list about how to automatically detect which version of Python to use for a particular script. I suggested that the POSIX practice of the first line containing "#!/usr/bin/yourPythonVerlsionHere" would be reasonable. Micheal Foord informed us that that idea was already in process. In a later message I suggested that the same method they talked about could also be adapted to start up a Jython script. I include the latest exchange... v v v v v v On 16/03/2011 3:43 PM Mark Hammond wrote: On 16/03/2011 1:28 AM, Michael Foord wrote: > > On 15/03/2011 07:18, Vernon Cole wrote: >> >> #!/usr/bin/ipy3 ... > There has been a long discussion recently on Python-dev [1] suggesting > the creation of exactly such a launcher program for Python on Windows. > Mark Hammond (copied) said he would implement it. Including IronPython > support is a fine idea. I've made a start on this. I've a 'reference implementation' in Python and am starting a PEP which I hope to post to python-dev in the next week or so (but please let me know if you would like to have a look at it before then). While I've been focusing on CPython, other implementations could be supported so long as this "launcher" could reliably locate them. For example, a shebang line of "/usr/bin/python2.6" could use the registry to locate the Python 2.6 implementation and execute it. If the shebang line specifies just "/usr/bin/python", then exactly how to determine which version to use is still up for grabs and as python-dev is never short of opinions <wink> I figured I'd leave that level of detail until there is more public discussion. If there is a reliable way to locate an IronPython implementation given just its version number, then the same basic scheme could certainly be used for IronPython or jython - but I'd be keen to have someone from those communities help with that side of things. The intention is that the final implementation would be written in C and be distributed with CPython, but that would depend on the support of python-dev for this scheme. However, that raises the question of how IronPython etc would actually get this launcher installed assuming no CPython installation exists. This too would need some feedback from the communities. Hope this is useful... Cheers, Mark ^ ^ ^ ^ ^ ^ ^ So I am approaching your group to see if there is interest in getting in on this. I have asked Mark for a copy of his code. I will try to adapt it to include IronPython -- and Jython if you all are interested and will feed me some correct skeleton code to use. -- Vernon Cole |