Jun-06-2023, 03:17 PM
Jun-06-2023, 03:38 PM
You don't import folders, you import packages and modules.
Are your trying to do this?
if test2 is a Python file, and file is an object in the test2.py file, you only need an __init__.py file in the test folder.
Are your trying to do this?
Output:test
|_test2
|_file
If so, the "test", "test2" and "file" folders need to contain a file named "__init__.py". This file can be empty. It's presence tells Python that this directory is part of a package.if test2 is a Python file, and file is an object in the test2.py file, you only need an __init__.py file in the test folder.
Output:test
|_ __init__.py, test2.py
Jun-06-2023, 03:44 PM
First read what the Python tutorial has to say about modules and packages