0

I want import a class from other python file.

project
└───src
│   │   main.py
│   │
│   └───spam
│       │   __init__.py
│       │   spamEmail.py
│       │   ...

Now, I want to import a class named spamEmailBayes from spamEmail.py in main.py

Which one is the correct import? This one:

from .spam.spamEmail import spamEmailBayes

or this one:

from spam.spamEmail import spamEmailBayes
Mr. Xcoder
  • 4,719
  • 5
  • 26
  • 44
Fred Feng
  • 159
  • 1
  • 5

0 Answers0