https://bluese05.tistory.com/31
Python class 명을 변수로 받아 동적 import 하기
Class 명을 변수로 받아 동적으로 import (Python Dynamic import) python 의 모듈을 import 할때는 보통 파일 초기에 선언하여 사용하는게 일반적이다. 그런데, 모듈을 처음부터 import 하지 않고 로직에..
bluese05.tistory.com
https://stackoverflow.com/questions/301134/how-to-import-a-module-given-its-name-as-string
How to import a module given its name as string?
I'm writing a Python application that takes as a command as an argument, for example: $ python myapp.py command1 I want the application to be extensible, that is, to be able to add new modules that
stackoverflow.com
https://blog.naver.com/city7310/221128089625
[Python] 동적 import
파이썬의 모듈을 import할 때는 보통 모듈의 상단에 선언하여 사용하는 게 일반적입니다. 하지만 import를 ...
blog.naver.com
import importlib
def load_module(module_name):
return importlib.import_module(module_name)
def load_module(module_name):
return __import__(module_name)
'[공부용]참고 사이트 모음 > [python]' 카테고리의 다른 글
[python] How to install packages offline? (0) | 2021.06.03 |
---|---|
파이썬 문자열 내장 함수 총 정리 (0) | 2021.06.02 |
[python] os.path.dirname(os.path.abspath(__file__)) 의 의미 (0) | 2021.06.01 |
Watchdog 큐 이벤트를 사용하는 Python 병렬 스레드 (0) | 2021.06.01 |
[python] watchdog 멀티 프로세싱 (0) | 2021.05.31 |