Import function from a file in root directory
<p>My file where I am working is at : <code>folder/src/views/basics.py</code>.</p>

<p>I want to import function in file where is present at : <code>folder/src/server.py</code>.</p>

<p>How to <strong>import function from server.py to basics.py</strong> ?
Note: I have made a __ init __.py file in <code>folder/src/</code> and <code>folder/src/views</code></p>

<pre><code>from ..server import Function
Function()
</code></pre>

<p>or</p>

<pre><code>from .. import server
server.Function()
</code></pre>

python