Import error in python
<p>In file1.py</p>

<pre><code>      def test1():
        print "hi"
</code></pre>

<p>In file2.py</p>

<pre><code>      from file1 import test1

      def test2():
        print "hello"

      test1()
      test2()
</code></pre>

<p>Output</p>

<pre><code>      hi
      hello
</code></pre>

<p>Now in file 1 if i include test2 i get the following error,Can some explain why and how to make it work.</p>

<pre><code>    from file2 import test2

    def test1():
      print "hi"

   Traceback (most recent call last):
   File "file1.py", line 1, in ?
   from file2 import test2
   File "/root/pyt/file2.py", line 1, in ?
   from file1 import test1
   File "/root/pyt/file1.py", line 1, in ?
   from file2 import test2
  ImportError: cannot import name test2
</code></pre>
