title: How to import variables in a different python file
body: <p>I am trying to import some variables from a different python file resides in the same directory from a another python file.</p>
  
  <p><strong>been trying this thing for hours and I still couldn't get the variables to use.</strong></p>
  
  <p>I have two files in the same directory as below:</p>
  
  <p><code>const.py</code></p>
  
  <p><code>test.py</code></p>
  
  <p>This is how <code>const.py</code> looks like</p>
  
  <pre><code>FOO = 1234
  NAMESPACE = "default"
  DEPLOYMENT_NAME = "deployment-test"
  DOCKER_IMAGE_NAME = "banukajananathjayarathna/bitesizetroubleshooter:v1"
  SERVICE_CLUSTER = "deployment-test-clusterip"
  SERVICE_NODEPORT = "deployment-test-nodeport"
  INGRESS_NAME = "deployment-test-ingress"
  </code></pre>
  
  <p>and this is how my <code>test.py</code> looks like:</p>
  
  <pre><code>import os 
  from . import constant
  
  print(constant.FOO)
  </code></pre>
  
  <p>error I am getting:</p>
  
  <blockquote>
    <p>ImportError: attempted relative import with no known parent package</p>
  </blockquote>
  
  <p>Why is it so hard to do this with Python?</p>