title: Access argparse variables from external module
body: <p>I have 4 modules:</p>
  
  <ul>
  <li><code>entry_point.py</code></li>
  <li><code>utils.py</code></li>
  <li><code>runner.py</code></li>
  <li><code>client.py</code></li>
  </ul>
  
  <p>I use <code>argparse</code> in <code>utils.py</code> and I want to be able to retrieve the value of one of those arguments in <code>client.py</code>. </p>
  
  <ul>
  <li><p>Entry point module (the one that gets called from console):</p>
  
  <pre><code>import utils
  def main():
      console_args = utils.parse_arguments() # Get command-line arguments
      runner.run(console_args) # The main function in the program
  
  if __name__ == '__main__':
      main()
  </code></pre></li>
  <li><p><code>utils.py</code> module:</p>
  
  <pre><code>def parse_arguments():
      parser = argparse.ArgumentParser()
      parser.add_argument(
          # Several arguments, one of which should be 'url'
      )
      return parser.parse_args()
  </code></pre></li>
  <li><p><code>runner.py</code> module:</p>
  
  <pre><code>import client
  
  def run(arguments):
      user = User.new(arguments.user_id)
      client.get_user_info(user)
  </code></pre></li>
  <li><p><code>client.py</code> module:</p>
  
  <pre><code>def get_user_info(user):
      url = _compose_url('user_status')
      resp = requests.post(url, data=user.id)
  
  def _compose_url(method):
      # TODO: get base_url from console arguments
      # base_url = ?
      return base_url + str(method)
  </code></pre></li>
  </ul>
  
  <p>I don't want to pass <code>url</code> as a parameter to <code>client.get_user_info()</code> because I don't think it would be good to have it as a parameter for that function. </p>
  
  <p>So I would like to be able to retrieve the argparse arguments I got from <code>utils.parse_arguments()</code> directly. Is there a way to do that?</p>