Home > database >  Is there a way to make Exceptions.Exceptions to Exceptions? I am using python
Is there a way to make Exceptions.Exceptions to Exceptions? I am using python

Time:08-07

I've already tried to do:

import Exceptions.Exceptions

This still doesn't work, I've also tried but this has given me a SyntaxError:

from . import Exceptions.Exceptions

This is a package if you need to know.

CodePudding user response:

I assume you want to import from a file Exceptions.py the class Exceptions. First you need to make sure that Exceptions.py is in your search path. The folder that you start your script in is usually in your search path.

Then you can do

from Exceptions import Exceptions

Afterwards you can use just Exceptions and it refers to the class.

  • Related