Recently in using Python I have often encountered problems with not being able to find the module. One of them is the case where parent directory subdirectories call each other. Here is a brief summary.
We create a test folder under the F:\Code folder
And inside the test folder is the following
Contains two subdirectories
def showdata(): print("this is a") def plus(): a=1 b=2 print(a+b)
def show(): print("this is b")
Calls a and b from the parent
from import showdata from import plus from import show showdata() show() plus()
You need to add ("...") if you want to call the a of another folder.
import sys ("..") from test1 import a as t ()
Above this Python parent directory, subdirectory call each other method is all that I have shared with you, I hope to be able to give you a reference, and I hope you will support me more.