From e353b7b2f16ba15c1a2ad2fbf17a9ad743eb8f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ot=C3=A1vio?= Date: Sat, 5 Nov 2022 09:10:17 -0300 Subject: [PATCH] =?UTF-8?q?Como=20importar=20coisas=20do=20seu=20pr=C3=B3p?= =?UTF-8?q?rio=20m=C3=B3dulo=20(ponto=20de=20vista=20do=20=5F=5Fmain=5F=5F?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aula97.py | 7 ++++++- aula97_m.py | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/aula97.py b/aula97.py index b359ae6..8d15594 100644 --- a/aula97.py +++ b/aula97.py @@ -9,5 +9,10 @@ # nos caminhos de sys.path import aula97_m +from aula97_m import soma, variavel_modulo -print('Este módulo se chama', __name__) +# print('Este módulo se chama', __name__) +print(aula97_m.variavel_modulo) +print(variavel_modulo) +print(soma(2, 3)) +print(aula97_m.soma(2, 3)) diff --git a/aula97_m.py b/aula97_m.py index 999839e..64b7200 100644 --- a/aula97_m.py +++ b/aula97_m.py @@ -1 +1,5 @@ -print('Este módulo se chama', __name__) +variavel_modulo = 'Luiz' + + +def soma(x, y): + return x + y