1 | initial version |
To indicate the type of a module using a relative path, follow these steps:
For example, if you have a module called 'my_module' located in the same directory as your main program file, you can indicate its type using the following import statement:
from . import my_module
Here, the .
signifies that the module is located in the same directory as the main program file, and my_module
is the name of the module file being imported.
If your module is located in a different directory, you can specify the relative path from the current directory to the module directory like this:
from ..utils import my_module
Here, ..
signifies that you want to move up one directory level from the current directory, and utils
is the name of the directory that contains the my_module
file.