Account(folder)
alimns.py (这里是要导入的)
mns_python(folder)
mns(文件夹)
account.py(被导入的)
How to import this
PHP中文网2017-07-05 10:29:14
First we have to jump to the same level as the Account file
import sys
sys.path.append('..')
Call the sys module, sys.path returns the search path of the module, and use the PYTHONPATH environment variable during initialization Value
.. Jump to the upper level directory
Then you can directly import account.py from mns_python.mns
Note: mns_python needs to have the __init__.py file (I got stuck here - I hope everyone can take this as a warning) )