Python newbie here. Any and all help on python structure would be much appreciated!
MAIN QUES: How to Import Multiple Python Modules from Other Directories
I've reassembled the repository for a project so that modules for specific tasks are within individual folders according to type of task instead of just one huge folder. Because my modules were all in one folder, I used to be able to import easily in this fashion:
import sys
sys.path.insert(0,'/home/myname/folder_name/all_modules')
Now, I have four module folders.
I want to import two of these modules into script_to_run.py .
What I tried that did not work:
import sys
sys.path.insert(0,'/home/myname/folder_name/email_modules')
sys.path.insert(0,'/home/myname/folder_name/gen_modules')
I've read a lot in the last three hours, but am still very confused about how to proceed. Any guidance, including useful links that I may not have encountered already, would be greatly appreciated. Thanks!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.