Python global variable usage
<p>I'm a bit of a beginner to coding in Python, which is a bit of a jump for me coming from Java. The question I have right now is about the use of global variables in Python for constants and such.
In Java, we sort of have two ideas for constants, we can have something like this:</p>

<pre><code>private static final HOME_URL_CONST = "localhost:8080";
</code></pre>

<p>Or if we need to assign the value at runtime:</p>

<pre><code>private static HOME_URL = "";
public void init(){ 
  HOME_URL = "localhost:8080"; 
}
</code></pre>

<p>The point is that in the latter case, once you set the static variable, it stays set. However in Python, this is not the case. If I create a global variable and then assign it in a function, that variable will only have the assigned value inside that function.
Right now i have something like this:</p>

<pre><code>def initialize():
  global HOME_URL
  with open("urls.txt", 'rb') as f:
    HOME_URL = json.load(f.read())['urls']
</code></pre>

<p>is this an acceptable method of doing this or are there some repercussions and side effects I'm not aware of?</p>
