Importing Files

anushya beauty abbi_0382 at yahoo.com
Fri Mar 3 00:40:44 EST 2006


Hi,
  
      I am new to this python. I have installed python 2.4 in my windows xp system. 
  
  My issue is:
  i have three directories with some files. 
  ex: Dir ---> Dir1 / file1.1.py
         "   ---> Dir2 / file2.1.py
         "   ---> Dir3 / file3.1.py
  These are the example directories i have. (Under Dir--->Dir1, Dir2  and Dir3; Under Dir1 --->file1.1.py; Dir2 ---> file2.1.py; Dir3  ----> file3.1.py) 
  In file3.1.py, i am importing the file1.1.py and file2.1.py using the command: 
  from file1.1 import *
  from file2.1 import  *
  
  Now, my problem is, file1.1 is imported and i can access the values  that are used in that file. But the file2.1 is not imported and  returning the error message as "ImportError: No module named file2.1".  I couldn't access the var used in that file. Actually, both the files  are from different directories only. Then, why onr file is imported and  another is not imported?.
  
  My Question is: How to import the files from the different directory to the current file?.
  
  Anybody please reply me, i have strucked in this simple file importing concept.
  
  Thanks and Regards,
  abbi.
  
		
---------------------------------
Relax. Yahoo! Mail virus scanning helps detect nasty viruses!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060302/bcf2707b/attachment.html>


More information about the Python-list mailing list