From 782e3d7f986475be155f1b79392ec2fdf5444951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ot=C3=A1vio?= Date: Sat, 5 Nov 2022 09:48:21 -0300 Subject: [PATCH] =?UTF-8?q?Recarregando=20m=C3=B3dulos,=20importlib=20e=20?= =?UTF-8?q?singleton?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aula98.py | 11 +++++++++++ aula98_m.py | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 aula98.py create mode 100644 aula98_m.py diff --git a/aula98.py b/aula98.py new file mode 100644 index 0000000..3f00364 --- /dev/null +++ b/aula98.py @@ -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') diff --git a/aula98_m.py b/aula98_m.py new file mode 100644 index 0000000..f4e98a3 --- /dev/null +++ b/aula98_m.py @@ -0,0 +1,3 @@ +print(123) + +variavel = 'Luiz 1'