Home > Software engineering >  from module import * using full path in python
from module import * using full path in python

Time:05-06

How do I write a code equivalent to

from mymodule import *

for a module in a given full path?

My question is similar to this question: How do I import a module given the full path? , except I want to "import * "

CodePudding user response:

I think the easiest way is to add your full path to sys.path:

import sys

sys.path.append('<path_to_folder_with_your_module>')

from mymodule import *
  • Related