Hello I look into the forum and find a lot of people who had this problem but the solutions were not successful for me!
I have one main file: "PythonApplication1.py" in the directory : "PythonApplication" In this directory I have an other directory : "classes" In "classes" I created 4 python files.
I just want to import one file (and next all the directory "classes") but nothing works! I try this: (in the main file : PythonApplication1.py)
import os
import os.path
import sys
sys.path.append('/classes/classeCarte.py')
print(os.getcwd())
# it gives me : :H/..../PythonApplication1 : its OK
#xxx = os.path.basename(path)
# I tried this : it gives me : "classeCarte.py"
#print(xxx)
carteTEST = Cartes(11, 4)
carteTEST.afficherValeur()
carteTEST.afficherCouleur()
At then end I call functions created in the class: "classeCarte.py" and it doesn't work. I have the error:
names Cartes is not defined
I tried to write at the beginning:
from classes import *
or just:
import /classes/classeCarte.py
It never worked ...
Thank you for your help!
ps: I work on VisualStudio and can see the tree may be is it help on this?