title: Set Global Variables in Function
body: <p>I have a problem where I am setting some global varaibles within a function. But when I go to access these global variables outside the function (in the main part of the script) those global varaibles were never set?</p>
  
  <p>Why do the following global variables always equal <code>0</code> and not <code>1</code>? How can I set the global variables within my function?</p>
  
  <pre><code>currentUserClientID             = 0
  currentUserMaxLicences          = 0
  currentUserActivatedLicences    = 0
  
  def setGlobals():
      currentUserClientID             = 1
      currentUserMaxLicences          = 1
      currentUserActivatedLicences    = 1
      print "Set Globals"
      print currentUserClientID
      print currentUserMaxLicences
      print currentUserActivatedLicences
  
  setGlobals()
  
  print "Global Values"
  print currentUserClientID
  print currentUserMaxLicences
  print currentUserActivatedLicences
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Set Globals
  1
  1
  1
  Global Values
  0
  0
  0
  </code></pre>