python 2.7 - importing files from multiple directories -


though have found multiple post on topic none has been proved solution problem.

i have directory structure- /home/ss/pos/ python module score.py tag.py rdrtag.py sits. importing score , rdrtag in tag.py. rdrtag.py importing functions other directory present in /home/ss/pos/

now need create python file in other location needs make call function in tag.py. using imp module's load_source function create module object , call function of tag.py . throws error no score rdrtaf module exist. other directory references used in rdrtag not working

import imp h=imp.load_source('tag',"/home/ss/pos/tag.py") 


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -