Recarregando módulos, importlib e singleton

This commit is contained in:
Luiz Otávio
2022-11-05 09:48:21 -03:00
parent e353b7b2f1
commit 782e3d7f98
2 changed files with 14 additions and 0 deletions

11
aula98.py Normal file
View File

@@ -0,0 +1,11 @@
import importlib
import aula98_m
print(aula98_m.variavel)
for i in range(10):
importlib.reload(aula98_m)
print(i)
print('Fim')

3
aula98_m.py Normal file
View File

@@ -0,0 +1,3 @@
print(123)
variavel = 'Luiz 1'