django - python 2 layer folder import
typecho
typecho 2017-07-05 10:27:14
0
1
941

Account(folder)

alimns.py (这里是要导入的)

mns_python(folder)

mns(文件夹)
    account.py(被导入的)

How to import this

typecho
typecho

Following the voice in heart.

reply all(1)
Ty80

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) )

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template