title: How can I import private methods in Python?
body: <pre><code>def __hello_world(*args, **kwargs):
    .....
  </code></pre>
  
  <p>and I tried</p>
  
  <pre><code>from myfile import __helloworld
  </code></pre>
  
  <p>I can import the non private one.</p>
  
  <p>How do I import private methods?</p>
  
  <p>Thanks.</p>
  
  <hr>
  
  <p>I am now using a single underscore.</p>
  
  <pre><code>Traceback (most recent call last):
    File "test.py", line 10, in &lt;module&gt;
      from myfile.ext import _hello_world
  ImportError: cannot import name _hello_world
  </code></pre>
  
  <p>in my test.py</p>
  
  <pre><code>sys.path.insert(0, os.path.abspath(
                      os.path.join(
                          os.path.dirname(__file__), os.path.pardir)))
  
  from myfile.ext import _hello_world
  </code></pre>