[ Cherney John ]
> Is there a way to add jar files to the classpath in an already
> running
> jython interpreter? I want to add another jar so I can import it
> without
> having to kill the interpreter, go back to the command line, modify
> my
> CLASSPATH environment variable, and restart the jython.bat
> interpreter. I
> was looking at sys.modules, but add and append didn't work. Looking
> at the
> printout of sys.modules, that kind of makes sense. Is there way of
> doing
> this?
You can try sys.add_extdir(jardir)
From JythonEssentials, p. 182:
"Forces Jython to scan all .jar or .zip files in jardir for Java
packages and classes."
Best wishes,
Oti.
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

Hi,
I've been trying to write some j2me Midlets with jython but until now I had
no success. Here is what I've done.
1=BA
I make a java Midlet in jython, MyMidlet.py. Then I compile it.
I receive some warnings related to assert and other
stuff being deprecated (I'm using j2se 1.4 on windows with jython 2.1). But=
=20
anyway
this are all warnings, I get no errors related with my midlet code. In my=20
Midlet I import
some javax.microedition stuff with no problem, I even pass the file from=20
jython and get no
syntax error.
So I have a MyMidlet.class and a MyMidlet$_PyInner.class, I also have a=20
MyMidlet.java.
2=BA
Now what I want is to run this code in the J2ME wireless toolkit=20
environment ktoolbar.
I have two options:
First: put MyMidlet.java in my j2me and try to compile it.... lots of=20
errors basically I'm missing some classpath settings in here.
Second: execute MyMidlet.class in my j2me emulator running like
if it was in a mobile phone... j2me wireless toolkit complains: "Unable to=
=20
load class org/python/core/PyObject", well I copy org directory to j2me=20
apps directory and now have
access to org* classes but it complains: "Cannot create class in system=20
package"... I'm looking
to j2me docs to find what this means...
Anyway I'm continuing to try to put this to work.
I'm just posting here to have one oportunity to have someone saying to me:
"man stop right now thats just impossible..." or maybe someone saying "hey=
=20
that should
be possible but you are cutting edge here..." or my favourite one "man=20
thats possible and
here is a link to a page where you can find a detailed howto on how to do=20
that" :-)
Best Regards,
Julio Silva

FYI, my wsad 5 install contains a jython.jar in the websphere 5 server lib
directory. Haven't used it yet, but I intend to. I'm just getting started
with jython and I'm excited about it. Been using Python for 3+ years and I
love it. Coding in Java because that is what work does. I hope to
integrate Jython in non-production stuff (testing, continuous build, etc.)
at first and then introduce it slowly to web apps.
I'd be very happy to see eclipse and wsad move to python friendly
environment (editor/debugger). (But then I'd like VI key bindings for the
editor too).
Cary
----- Original Message -----
From: "Frank Cohen" <fcohen@...>
To: "Kevin Altis" <altis@...>
Cc: <jython-users@...>
Sent: Monday, May 12, 2003 10:27 PM
Subject: Re: [Jython-users] Eclipse and Jython/Python
> Hi Kevin: Glad to provide you with the great info. PushToTest is myself
> fulltime, 3 engineers parttime, about 20 contributors to the
> open-source project, and approximately 35,000 users. I am available
> for contracts, as are the rest of the team. I'd be happy to help you
> and IBM.
>
> By the way, I'm published on IBM developerWorks about 6 times now -
> with 3 more articles on the way - if that will help you with your IBM
> contact. :-) If you want to see what I've done with Jython and
> WebSphere look at my new book "Automating Web Tests using TestMaker" at
> http://www.pushtotest.com/ptt/books/awtbook.html.
>
> -Frank
>
>
>
> On Friday, May 9, 2003, at 11:13 AM, Kevin Altis wrote:
>
> > Frank, this is great info! The other project I want to raise at IBM is
> > embedding Jython into WebSphere and that sounds even more in line with
> > what
> > you're already doing. I was going to hold off on the WebSphere idea
> > until
> > the Eclipse integration got started and I had a better contact inside
> > IBM.
> > However, I think as of next Wednesday I may have the right contact, so
> > any
> > ideas along that front would be quite welcome. Maybe that would have
> > more
> > benefit for your core business? Is PushToTest just you or do you have a
> > team?
> >
> > Keep in mind that my underlying motivation for pushing the
> > Jython/Python
> > integration with Eclipse and WebSphere is to raise the visibility of
> > Python
> > inside IBM. I would very much like IBM within the next couple of years
> > to
> > step behind Python in a big way just like they did for Apache and
> > Java. That
> > is a long term goal, but that's my thinking.
> >
> > ka
> > ---
> > Kevin Altis
> > altis@...
> > 503-236-9533
> > http://altis.pycs.net/
> > http://www.pythoncard.org/
> >
> >> -----Original Message-----
> >> From: jython-users-admin@...
> >> [mailto:jython-users-admin@...]On Behalf Of Frank
> >> Cohen
> >> Sent: Friday, May 09, 2003 8:54 AM
> >> To: jython-users@...
> >> Subject: Re: [Jython-users] Eclipse and Jython/Python
> >>
> >>
> >> Hi Kevin: Thanks for the update. I've been embedding Jython in my
> >> TestMaker open-source project for the past year with great success.
> >> (Details at http://www.pushtotest.com.) TestMaker is built on
> >> NetBeans.
> >> NB provides the GUI elements, file navigator and a good script editor.
> >> In addition to writing test agents in Jython the scripting language
> >> can
> >> access all of NB's objects. So a by-product is that NB gets its own
> >> script/macro language. Eclipse would benefit in the same way. Plus, in
> >> my opinion Eclipse is becoming bloated with so many disparate plug-ins
> >> that it needs a script language to show some synergy between the
> >> plug-ins.
> >>
> >> Here's what I think would be involved with adding Jython to Eclipse:
> >> 1) Embed the Jython interperter (very easy)
> >> 2) Write a simple support object in Java that provides a gateway to
> >> the
> >> Eclipse APIs.
> >> 3) Write Jython syntax highlighting and code lookup (not easy in
> >> Eclipse)
> >> 4) Write 5-10 sample Jython scripts that demonstrate the Eclipse
> >> environment and how to call Eclipse APIs.
> >> 5) Write an article for IBM developerWorks explaining the project,
> >> benefits and tutorial.
> >> 6) Write a book: Jython on Eclipse for SAMS (well maybe I'm getting
> >> carried away. hehe)
> >>
> >> None of this is particularly difficult, but it does take a lot of
> >> time.
> >> I'm overcommitted to PushToTest.com projects, but I would like to
> >> help.
> >> If someone else wants to take on the code writing I would be available
> >> to write the supporting articles and docs.
> >>
> >> -Frank
> >>
> >>
> >>
> >> On Wednesday, May 7, 2003, at 03:55 PM, Kevin Altis wrote:
> >>
> >>>> From: Updike, Clark
> >>>>
> >>>> Would you mind updating the jython-user list with a post regarding
> >>>> the
> >>>> status of your efforts to-date to start up a jython plug-in for
> >>>> eclipse with
> >>>> the eclipse folks? It seems like there is a lot of interest at
> >>>> the moment.
> >>>>
> >>>> TIA,
> >>>> Clark
> >>>
> >>> Last week quite a few Jython users sent me replies (some privately
> >>> and
> >>> some
> >>> to the list) expressing interest in Jython/Python/Eclipse
> >>> integration.
> >>> [Rather than repeatedly saying Jython/Python below I'll just say
> >>> Jython, but
> >>> many of the issues are also applicable to C Python.] Those ideas need
> >>> to be
> >>> discussed on the mailing list and captured on one or more web pages.
> >>> To
> >>> start the process, I went ahead and created a wiki page on python.org
> >>> as a
> >>> placeholder. Please add to the page.
> >>>
> >>> http://www.python.org/cgi-bin/moinmoin/EclipsePythonIntegration
> >>>
> >>> I talked to Paul Buck, Director of Eclipse Development at IBM last
> >>> Friday.
> >>> The call went extremely well. Paul said that he thought full Jython
> >>> support
> >>> was a good idea, but he could not commit his team or other IBM
> >>> employees at
> >>> this time to do the work. OTOH, he was willing to create a Jython
> >>> Eclipse
> >>> sub-project and have his team provide technical support and
> >>> information to
> >>> whoever heads up the project. The C/C++ Development Tools sub-project
> >>> might
> >>> be a good example to follow.
> >>>
> >>> http://www.eclipse.org/cdt/
> >>>
> >>> The overall tone of the conversation was one of eagerness to help
> >>> facilitate
> >>> making it happen, but at this early stage he couldn't commit any of
> >>> his team
> >>> members to writing code for it. He was also interested in embedding
> >>> Jython,
> >>> though he was not that familiar with Jython.
> >>>
> >>> The issue was raised about how much interest there was for this
> >>> project both
> >>> for Jython users and existing Eclipse users. I said that there was a
> >>> high
> >>> interest level on the Jython side of the fence but that many
> >>> Java/Eclipse
> >>> users might not be familiar with Jython or Python or understand the
> >>> value of
> >>> Jython support in Eclipse, so we probably need to get at least a
> >>> rough
> >>> first
> >>> pass done for the benefits to be more obvious. At that time, IBM
> >>> might
> >>> want
> >>> to commit some of its own resources to furthering the project.
> >>>
> >>> Paul asked if I would be interested in taking the technical lead to
> >>> make it
> >>> happen. I declined because I don't have the right skill set, but I
> >>> said I
> >>> would try and find one or more people to get the project started. Any
> >>> volunteers? I emailed Paul links for more info on Jython as well as
> >>> the two
> >>> projects I could find that are relevant. We need to know the current
> >>> state
> >>> of the two projects below as well as any other Eclipse/Jython
> >>> projects
> >>> I
> >>> might have missed.
> >>>
> >>> PyEclipse is a Python plugin for the Eclipse platform
> >>> http://sourceforge.net/projects/pyeclipse/
> >>>
> >>> Python Editor for Eclipse (Pe4elcipse) is an Eclipse platform plugin
> >>> for
> >>> editing and debugging Python applications.
> >>> http://sourceforge.net/projects/pe4eclipse
> >>>
> >>> After my phone call with Paul, I talked to Jim Hugunin at Xerox PARC.
> >>> Jim
> >>> also said that he thought Jython integration and full Jython support
> >>> inside
> >>> Eclipse was a great idea, but he stressed the need for a lead
> >>> developer to
> >>> make it happen and said that due to other research commitments, he
> >>> was
> >>> unable to participate.
> >>>
> >>> Samuele Pedroni sent me a detailed list of issues and ideas offlist.
> >>> I'll
> >>> let him repost those to the list and wiki rather than taking his
> >>> points out
> >>> of context.
> >>>
> >>> I don't think I could have hoped for a better first conversation with
> >>> Paul.
> >>> If we want this to happen, the ball is in our court and one or more
> >>> volunteers can take it to the next level.
> >>>
> >>> ka
> >>>
> >>>> ref:
> >>>> http://sourceforge.net/mailarchive/forum.php?thread_id=2044937&for
> >>>> um_id=5586
> >>>>
> >>>> -----Original Message-----
> >>>> From: Kevin Altis [mailto:altis@...]
> >>>> Sent: Sunday, April 27, 2003 3:14 PM
> >>>> To: jython-users@...
> >>>> Subject: [Jython-users] Eclipse and Jython/Python
> >>>>
> >>>>
> >>>> I would like to hear from anyone ASAP that is using Eclipse or
> >>>> would like to
> >>>> use Eclipse with Python/Jython.
> >>>>
> >>>> http://www.eclipse.org/
> >>>>
> >>>> I think it would be great to get full syntactic support for
> >>>> Jython/Python
> >>>> and have Jython embedded into Eclipse. Since Jim Hugunin is
> >>>> listed as one of
> >>>> the Eclipse sub-project leads I figure at least some people involved
> >>>> with
> >>>> Eclipse might be sympathetic to this idea, but I have not been
> >>>> able to reach
> >>>> Jim yet, so I don't know what he thinks.
> >>>>
> >>>> http://www.eclipse.org/technology/team-leaders.html
> >>>>
> >>>> I have arranged a brief phone call with Paul Buck, Director of
> >>>> Eclipse
> >>>> Development at IBM on Friday, May 2nd to discuss the idea.
> >>>>
> >>>> http://conferences.oreillynet.com/cs/os2003/view/e_spkr/1529
> >>>>
> >>>> I would appreciate feedback before Thursday, May 1st if you would
> >>>> like to
> >>>> see this happen. In particular, I need a specific list of benefits
> >>>> to
> >>>> Java
> >>>> and Jython/Python programmers if they had full Jython/Python
> >>>> syntax support
> >>>> and the ability to use Jython from with Eclipse. I have some
> >>>> general benefit
> >>>> points, but I don't program in Java day-to-day so people on this
> >>>> list should
> >>>> be able to give me better specifics.
> >>>>
> >>>> Thanks,
> >>>>
> >>>> ka
> >>>> ---
> >>>> Kevin Altis
> >>>> altis@...
> >>>> http://altis.pycs.net/
> >>>> http://www.pythoncard.org/
> >>>
> >>>
> >>>
> >>> -------------------------------------------------------
> >>> Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
> >>> The only event dedicated to issues related to Linux enterprise
> >>> solutions
> >>> http://www.enterpriselinuxforum.com
> >>>
> >>> _______________________________________________
> >>> Jython-users mailing list
> >>> Jython-users@...
> >>> https://lists.sourceforge.net/lists/listinfo/jython-users
> >>>
> >>>
> >> --
> >> Frank Cohen, Founder, PushToTest, http://www.PushToTest.com, phone:
> >> 408
> >> 374 7426
> >> Come to PushToTest for free open-source test automation solutions that
> >> test and monitor
> >> Web-enabled applications, especially Web Services for scalability and
> >> reliability.
> >>
> >>
> >>
> >>
> >> -------------------------------------------------------
> >> Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
> >> The only event dedicated to issues related to Linux enterprise
> >> solutions
> >> http://www.enterpriselinuxforum.com
> >>
> >> _______________________________________________
> >> Jython-users mailing list
> >> Jython-users@...
> >> https://lists.sourceforge.net/lists/listinfo/jython-users
> >>
> >
> >
> --
> Frank Cohen, Founder, PushToTest, http://www.PushToTest.com, phone: 408
> 374 7426
> Come to PushToTest for free open-source test automation solutions that
> test and monitor
> Web-enabled applications, especially Web Services for scalability and
> reliability.
>
>
>
>
> -------------------------------------------------------
> Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
> The only event dedicated to issues related to Linux enterprise solutions
> http://www.enterpriselinuxforum.com
>
> _______________________________________________
> Jython-users mailing list
> Jython-users@...
> https://lists.sourceforge.net/lists/listinfo/jython-users
>