Skip to content

Commit e9531b2

Browse files
committed
i4dynamic imports
1 parent 176b8a7 commit e9531b2

4 files changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import importlib
2+
3+
module_name = input("Load module: ")
4+
5+
if module_name != "":
6+
module = importlib.import_module(module_name)
7+
module.say_hello()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
def say_hello():
2+
print("Hello from module_a")
3+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
def say_hello():
2+
print("Hello from module_b")
3+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
def say_hello():
2+
print("Hello from module_c")
3+

0 commit comments

Comments
 (0)