I have a scenario where i am trying to import the contents in file and use it my script
I have a path : /d/demo
in this path i have a abc.py
file
This abc.py file contains some pre-defined parameters that i need to use
Taking the filename into a variable : varname
Taking the filepath into a variable : varpath
My script :
import sys
varpath='/d/demo'
varname='abc'
sys.path.append(varpath)
from varname import *
This approach is not working : The from varname import *
is not replaced with filename like this from abc import *