Access local variable in function from module
<p>I have a function in my main program that attempts to retrieve information from an imported module, which is a different script I wrote. This module spits out a variable which I access from the main program by making it a global.</p>

<p>However, since I'm threading the function that requests the information, the global variable gets polluted by adding the information from separate requests into one var. What I'm looking for is a way to access a local variable in a function in a module.</p>

<p>Main program:</p>

<pre><code>import module

def threaded_function():
    module.function(var1, var2)
    print module.output
</code></pre>

<p>Module:</p>

<pre><code>def function(var1, var2):
    global output  
    output = []
    DoThingsWithVars(var1, var2)
    output.append(result)
</code></pre>

<p>Since the threading causes it to get accessed multiple times I figured I'd not use global variables and get the local variables for each request. Any idea how I can get at those?</p>
