Importing Files

anushya beauty abbi_0382 at yahoo.com
Fri Mar 3 03:17:52 EST 2006


Hi,
  
      I am very sorry for confusing you with the file  names. Now i want to say you one more thing and i change my ex  filenames to the exact filenames.
  The below is  what i explained in my previous mail:
  **********
   My files are: 
  1. D:\TestDir\module\config.py
  2. D:\TestDir\scripts\http.py
  3. D:\TestDir\work\path_config.py
  
  Here I am running config.py, imported the http.py and path_config.py  (from path_config import * and from http import *). Now, i can access  the values from path_config in config.py, where, not the values from  http.py.
  
  ************
  as you said, My sys.path gives as: 
    >>> sys.path
    ['C:\\Python24\\Lib\\idlelib', 'C:\\Python24\\python24.zip',  'C:\\Python24', 'C:\\Python24\\DLLs', 'C:\\Python24\\lib',  'C:\\Python24\\lib\\plat-win', 'C:\\Python24\\lib\\lib-tk',  'C:\\Python24\\lib\\site-packages']
  
  (My files are in D:\\)
  IMP:  Now, i found, In  this C:\\Python24 directory, the path_config.pyc is created.(I am  sorry, i dont know when and how it is created). So, it is able to  access the values of path_config file. I tried to create http.pyc file  in the Python24 directory(manually) and import in config file, now it  is imported, but not able to access the values (may be because of  creating manually). From this I understood that the module should be in  the sys.path directory (as you said). 
  
  (I am very sorry, if it again confused you, and please bare with me)
  
  How this pyc file is automatically created?. Or else, please tell me, How to create a pyc file for a py file?
  
  thanks and regards,
  abbi
  
  
  
		
---------------------------------
 Yahoo! Mail
 Use Photomail to share photos without annoying attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060303/be15233d/attachment.html>


More information about the Python-list mailing list