How to save state of execution in python
<p>i have an assignment in python for which some complicated idea is needed.
please help me . . . . . 
suppose initially i have a file to load into an array 'arr01' then i have two python source code file say 'a.py' and 'b.py'.</p>

<p>a.py takes some element from that loaded array 'arr01' and modifies the array 'arr01' and send an argument to b.py.</p>

<p>b.py will generate a string 'str' and whenever nedded further data it wil call a.py to send more elements. </p>

<p>the problem here is that the array arr01 should to loaded and the execution state of a.py and b.py must be saved because b.py will call a.py whenever element is needed and a.py must have to keep the track of elements that it has sent to b.py from arr01</p>

<p>how can i use both a.py and b.py simutaniously?</p>

<p><code>from a import function_name</code></p>

<p><code>from b import other_function_name</code></p>

<p>From here, you can use a.py and b.py functions in this python file.</p>

<p>E.g.</p>

<h1>a.py</h1>

<p><code>def say_hi():
    print 'hello'
</code></p>

<h1>b.py</h1>

<p><code>from a import say_hi
say_hi()</code></p>

python python-2.7 python-3.x