Bonjour,
Je cherche à utiliser un même module pour deux programmes,
mais je ne sais pas faire suivant cette structure:
myprojects
-- Myproject_1
----- MyprojectMain_1.py ( from Commun.Subprogram_1 import calcul_1)
-- Myproject_2
----- MyprojectMain_2.py ( from Commun.Subprogram_1 import calcul_1)
-- Commun
----- Subprogram_1.py (def calcul_1():)
----- Subprogram_2.py
Existe-t-il une solution pour eviter de dupliquer le dossier "Commun"?
Les deux exemples ci-dessous correspondent à une façon de faire, mais qui me parait complexe.
d'avance merci.
--------------------------------
Je sais faire, mais cela duplique le dossier "Commun".
myprojects
-- Myproject_1
----- MyprojectMain_1.py ( from Commun.Subprogram_1 import calcul_1)
-------- Commun
----------- Subprogram_1.py (def calcul_1():)
----------- Subprogram_2.py
-- Myproject_2
------- MyprojectMain_2.py ( from Commun.Subprogram_1 import calcul_1)
-------- Commun
----------- Subprogram_1.py (def calcul_1():)
----------- Subprogram_2.py
--------------------------------
Dans le même esprit, j'ai besoin d'appeler une fonction de MyprojectMain_2.py depuis MyprojectMain_1.py,
Ce qui ferait:
myprojects
-- Myproject_1
----- MyprojectMain_1.py ( from Commun.Subprogram_1 import calcul_1 )
( from Myproject_2.yprojectMain_2 import toto )
-------- Commun
----------- Subprogram_1.py (def calcul_1():)
----------- Subprogram_2.py
-------- Myproject_2
----------- MyprojectMain_2.py ( from Commun.Subprogram_1 import calcul_1 )
( def toto(): )
----------- Commun
---------------- Subprogram_1.py (def calcul_1():)
--------------- Subprogram_2.py