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

R

Reckoner

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.
 
D

Daniel Fetchinson

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
 
R

Reckoner

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


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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top