title: Python - most convenient way to define constant variables used just once
body: <p>Let's say I have a file "icon.ico" and an url "url.com".<br/>
  The'll be used just once within the class - "icon.ico" will be set to some window and we'll do the request to url in one method.<br/>
  I have three ways to define these variables.<br/></p>
  
  <p><strong>1-st way - define as global constants</strong></p>
  
  <pre><code>#in the top of the file
  ICON = "icon.ico"
  URL = "http://url.com"
  
  #and then
  def setIcon(self):
      self.setWindowIcon(QtGui.QIcon(ICON))
  
  def getData(self):
      content = requests.get(URL).content
  </code></pre>
  
  <p><strong>2-nd way - define as variables of the class</strong></p>
  
  <pre><code>def __init__(self):
      self.url = "http://url.com"
      self.icon = "icon.ico"
  </code></pre>
  
  <p><strong>3-rd way - define just within the method the'll be used</strong></p>
  
  <pre><code>def setIcon(self):
      icon = "icon.ico"
  
  def getData(self):
      url = "http://url.com"
  </code></pre>