Click here to Skip to main content
15,888,157 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends,

My doubt is, as to how to import files from different directories?. I imported the Sys module and then added the path from where i wanted to import the files.

For example i want to import files from the local drive E:/

CODE:
import sys
p='E:/'
sys.path.insert(0,p)

- Now when i do an import it says "no module present".

any suggestions would be appreciated.

Thanks,
- Rahul
Posted
Comments
Richard MacCutchan 27-Apr-15 6:27am    
I just tried the same thing and it worked fine. Please show the content of your path variable, and the exact sequence of events in your script.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900