|
From: Jim B. <jim...@py...> - 2015-03-29 05:45:31
|
As of https://hg.python.org/jython/rev/23c3effa5d4f, I changed sys.ps1 and sys.ps2 such that they are only defined if Jython is in an interactive mode, per https://docs.python.org/2/library/sys.html#sys.ps1. So the sitecustomize workaround I mentioned can now work as expected. This will be part of the next release candidate. - Jim On Thu, Mar 26, 2015 at 9:37 PM, Jim Baker <jim...@py...> wrote: > David, > > Thanks for reporting this! > > As you mention, support for PYTHONSTARTUP is currently missing from > Jython, but it could be readily added in a future release (hopefully 2.7.1, > but always a question of prioritization). > > In the meantime, you could use sitecustomize (see > http://pymotw.com/2/site/#sitecustomize for a good description on how to > use this support), and use that check for the PYTHONSTARTUP environment > variable. But the challenge here is to determine if the session is > interactive or not. In CPython, you can do by checking hasattr(sys, "ps1"), > but sys.ps1 is always defined currently in Jython, regardless if > interactive or not. (Should be fixed as well.) There may be another way of > performing this check, but I'm not aware of it at this time. > > Please feel free to file bugs at http://bugs.jython.org/ > > - Jim > > > On Wed, Mar 25, 2015 at 10:57 AM, David Charles < > dav...@gm...> wrote: > >> I have installed this to Jython: >> >> * https://github.com/darius/columnize >> >> And I would like to make it automatically available to all of my >> interactive Jython sessions. However, Jython does not seem to respect >> PYTHONSTARTUP (nor JYTHONSTARTUP). >> >> I have found that I can arrive at nearly the same effect if I add the >> necessary statements to ~/.pythonrc.py and then execute: >> >> >>> from user import * >> >> However, I would like to be able to type nothing at all. >> >> Suggestions? >> >> David >> >> >> >> ------------------------------------------------------------------------------ >> Dive into the World of Parallel Programming The Go Parallel Website, >> sponsored >> by Intel and developed in partnership with Slashdot Media, is your hub >> for all >> things parallel software development, from weekly thought leadership >> blogs to >> news, videos, case studies, tutorials and more. Take a look and join the >> conversation now. http://goparallel.sourceforge.net/ >> _______________________________________________ >> Jython-users mailing list >> Jyt...@li... >> https://lists.sourceforge.net/lists/listinfo/jython-users >> >> > > > -- > - Jim > > jim.baker@{colorado.edu|python.org|rackspace.com|zyasoft.com} > twitter.com/jimbaker > github.com/jimbaker > bitbucket.com/jimbaker > -- - Jim jim.baker@{colorado.edu|python.org|rackspace.com|zyasoft.com} twitter.com/jimbaker github.com/jimbaker bitbucket.com/jimbaker |