Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > access variables from one Python session to another on the samemachine?

Reply
Thread Tools

access variables from one Python session to another on the samemachine?

 
 
Reckoner
Guest
Posts: n/a
 
      06-09-2008
Suppose I have two different command windows going on the same
machine, each running their own Python interpreters.

Is it possible to access the variables in one of the interpreter-
sessions from the other?

It turns out I have limited control over one of the sessions (i.e.
cannot control all the code that is run from there), but complete
control over the other.

I get the feeling this has been asked before, but I'm not sure how to
pose the question in such a way that it would show up on a search.
It's confusing.

Thanks.
 
Reply With Quote
 
 
 
 
Daniel Fetchinson
Guest
Posts: n/a
 
      06-10-2008
> Suppose I have two different command windows going on the same
> machine, each running their own Python interpreters.
>
> Is it possible to access the variables in one of the interpreter-
> sessions from the other?
>
> It turns out I have limited control over one of the sessions (i.e.
> cannot control all the code that is run from there), but complete
> control over the other.
>
> I get the feeling this has been asked before, but I'm not sure how to
> pose the question in such a way that it would show up on a search.
> It's confusing.


Depending on what 'limited control' means, the simplest choice would
be writing stuff to a plain text file from the master and reading it
from the slave. This may or may not work depending on your environment
though.

Cheers,
Daniel
--
Psss, psss, put it down! - http://www.cafepress.com/putitdown
 
Reply With Quote
 
 
 
 
Reckoner
Guest
Posts: n/a
 
      06-10-2008
On Jun 9, 5:23 pm, "Daniel Fetchinson" <(E-Mail Removed)>
wrote:
> > Suppose I have two different command windows going on the same
> > machine, each running their own Python interpreters.

>
> > Is it possible to access the variables in one of the interpreter-
> > sessions from the other?

>
> > It turns out I have limited control over one of the sessions (i.e.
> > cannot control all the code that is run from there), but complete
> > control over the other.

>
> > I get the feeling this has been asked before, but I'm not sure how to
> > pose the question in such a way that it would show up on a search.
> > It's confusing.

>
> Depending on what 'limited control' means, the simplest choice would
> be writing stuff to a plain text file from the master and reading it
> from the slave. This may or may not work depending on your environment
> though.
>
> Cheers,
> Daniel
> --
> Psss, psss, put it down! -http://www.cafepress.com/putitdown



This disk-writing approach seems to be simplest & less intrusive.
Thanks! I'll try it.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Classes in a class: how to access variables from one in another Python 33 10-20-2010 07:11 PM
How to access: a page from a User control, and another User controlfrom another one? qwerty ASP .Net 3 09-30-2004 05:32 PM
Session State - What does it take to establish one single ASP.NET session per "browser session" Jeff Smythe ASP .Net 3 01-02-2004 04:10 AM
Using One XSLT and multiple XML Problem (One is XML and another one is XBRL) loveNUNO XML 2 11-20-2003 06:47 AM
Passing value from one script on one page to another script on another page. Robert Cohen ASP General 3 07-15-2003 01:46 PM



Advertisments