From: Frank C. <fc...@pu...> - 2002-10-30 16:56:15
|
Thanks for the tip. I'll change my code to use interpreter.set(). Thanks. -Frank -- Frank Cohen, Founder, http://www.PushToTest.com, phone: 408 374 7426 PushToTest offers free open-source test software and global services solutions that test, monitor and automate Web Service systems for functionality, scalability and performance. > From: Oti <oh...@ya...> > Date: Mon, 28 Oct 2002 11:50:24 -0800 (PST) > To: Frank Cohen <fc...@pu...>, jyt...@li... > Subject: Re: [Jython-users] Creating variables while embedding > > [ Frank Cohen ] >> I embed Jython into NetBeans to provide a scripting language for the >> TestMaker environment. Jython is instantiated and I use execfile to >> run a >> script. I need to pass in the path and file name of the script that >> is being >> run into the script. Currently I am using >> exec("scriptpath="+scriptpath) and >> then I use execfile() to run the script. Doing this gives the script >> the >> scriptpath variable. >> >> Is this the best way to go? What is the better solution? > > Hello Frank, > > if the java object already exists outside the interpreter, you can use > interpreter.set( String name, Object value ) > to set a variable in the local namespace. In your example, this would > be: > interpreter.set( "scriptpath", scriptpath ) > which saves you a dynamic compile. > > Best wishes, > Oti. > > __________________________________________________ > Do you Yahoo!? > Y! Web Hosting - Let the expert host your web site > http://webhosting.yahoo.com/ > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |