How do I set a top level variable in Python?
<p>Let's say I have a script file, like so:</p>

<pre><code>foo = 1

def bar():
    return foo

# The Main function for this script.
def main(argv=None):
    foo = 2
    print bar()
    return
</code></pre>

<p>This prints 1.
Is there any way to set the value of foo at the script-level from main?</p>
