473,395 Members | 1,666 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,395 software developers and data experts.

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

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.
Jun 27 '08 #1
3 857
Reckoner 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.

Thanks.

IMHO without "significant" access to both programs I believe the answer is no.
You would have to introduce something in the master window that would "expose"
data to the slave window. Normally this is done via: socket server, pipes,
shared database, etc.

Does the master, provide output that could be captured and used as input to the
slave? If so, you might be able to use subprocess module to make it work.

-Larry
Jun 27 '08 #2
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
Jun 27 '08 #3
On Jun 9, 5:23 pm, "Daniel Fetchinson" <fetchin...@googlemail.com>
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.

Jun 27 '08 #4

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

Similar topics

1
by: Dave Smithz | last post by:
Hi there, I have implemented a login sequence using session variables for a PHP/MySQL DB which I took over development. I read some books and this NG and it seemed straight forward. However the...
4
by: Jason Us | last post by:
Does anyone have experience with passing variables from an ASP page to a JSP page. The way it currently works in passing the SSN in the URL. This cannot be good. I thought that storing a...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
0
by: totierne | last post by:
comp.databases.ms-access, I want to know how to use Oracle views with session variables in Access. The parameterised views in access, are migrated to views with per session variables. The...
8
by: Floris van Haaster | last post by:
Hi All! I have a question, i have a web application and I store some member information in a variable i declared in a module like: Public some_info_variable as string in module1.vb But...
18
by: BillE | last post by:
When a user opens a new IE browser window using File-New-Window the integrity of an application which relies on session state is COMPLETELY undermined. Anyone who overlooks the fact that...
2
by: Kenneth McDonald | last post by:
I'm doing some work with a Python program that works hand-in-hand with the DOM on a local client (processing DOM events, issuing DOM modification commands, etc.) I'm currently using cherrypy as the...
5
by: Sandman | last post by:
I dont think I understand them. I've read the section on scope in the manual inside out. I'm running PHP 5.2.0 Here is the code I'm working on: //include_me.php <?php $MYVAR = array(); global...
1
by: dixcyn04 | last post by:
Ok, now I've run into another little hiccup in my application. The ability to update records already in existance. What is bugging me about this, is the code I will submit was what I found on forums...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.