setting a function = to variable, will that result in function executing each time variable is called?
<p>This is a noob question, and i'm fairly certain the function will only execute once but I want to be clear. I am using python and urllib to login to a website. Once logged in, there is a user id associated with my account that will allow me to navigate the site. However I don't want to be logging in with each call to the variable so I was wondering if calling the variable would result in a login again or if the login function only executes if I explicitly run my login function?</p>

<pre><code>def login(username,pw):
     #some calls to HTTP server using urllib
     return user_id

user_id = login('abc@hotmail.com','mypassword') 

def search():
    #calls to HTTP to perform a search on a page on the website
    #I need to reference user_id and I want to know if user_id will simply be 
    # the integer user_id or if it will call the login function each time I reference it
</code></pre>
