473,383 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

keep Java object alive between two script

Hi,

This is more of a Jython question, I guess.
Say I have a Java program MyJavaClass which will be called from two Jython
scripts: script_1.py and script_2.py:
----------------------------------------------
#script_1.py
from MyJavaClass import *

myObj = MyJavaClass()
myObj.startJavaFunc() #startJavaFunc() is a method in MyJavaClass()

==============================
Then I have a Manager class that will invoke these scripts, as shown below:
------------------------------------------------
package TestSuiteManager;
import org.python.util.PythonInterpreter;
import org.python.core.*;

public class TestSuiteManager {

public static void main(String[] args)
{
PythonInterpreter interp = new PythonInterpreter();
interp.execfile("script_1.py");
// will I be able to keep "myObj" alive after the execution of
script_1.py ?
// will I be able to somehow get the object "myObj" that was created
in script_1.py and use it?
interp.execfile("script_2.py");
}
}
================================
My questions are written in the program above as comments.

Thanks everyone in advance.
Wilson Chew
Summer Intern,
Qualcomm. Inc.
Jul 18 '05 #1
0 979

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Angus SC2 | last post by:
Hello, I have a connection to a mysql server on my website that I would like to keep "alive" from when a user first goes to a page that requires the connection until they close the website How...
1
by: David | last post by:
This is called "evil hack problem" because my problems are due to me trying to do an evil hack. Please don't judge me, just believe that there are reasons for what I'm trying to do :-) I've got...
0
by: Gil Strauss | last post by:
When using .net framework HttpWebRequest object, how can we set the connection header to "keep-alive" Acording to Microsoft ducomentation, setting the keepAlive property to true, should do the job,...
1
by: cppdev | last post by:
Hello, After reading a few articles, http://blogs.gotdotnet.com/cbrumme/PermaLink.aspx/e55664b4-6471-48b9-b360-f0fa27ab6cc0...
1
by: Nuno Magalhaes | last post by:
With the sniffer ethereal I get a lot of Connections Keep Alive in some sites like google.com and that returns me the Content-Length in the HTTP response header. When the connection is Close I...
7
by: mail747097 | last post by:
I would like to keep IIS alive on my web site and prevent Application_End from occuring in global.asax. Any ideas?
0
by: richard.krehbiel | last post by:
I've been googling for half a day now and have found answers on both sides of the argument. Baiscally it's this: I am using PHP 5.0.4 (I can upgrade if that's a solution) as an ISAPI module under...
1
by: =?Utf-8?B?QWxwaGFwYWdl?= | last post by:
Hello, I have built an object which does some jobs on a particular server. There can have lots of this object running concurrently. I want to know what is the best way to optimize my...
3
by: alireza6485 | last post by:
Hi, Could sme one please translate the following code from C to Java for me? Code : /* Polytechnic University of the Philippines Sta.Mesa, Manila College of Computer Management and...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.