title: Global variables in Python 3 class
body: <p>How to use a global variable inside the initialiser of a class in Python 3?</p>
  
  <p>for eg</p>
  
  <pre><code>import urllib
  from urllib.request import urlopen
  class ABC(object):
   def __init__(self):
     x=urlopen('http://www.google.com/').read()
  </code></pre>
  
  <p>How do I convert x into a global variable?</p>