多文件的組織
跨目錄級導入模塊
from ..xxfile import xxmodule #從上級目錄中的xxfile中導入xxmodule
import xxsub_dir.xxfile #從xxsub_dir文件夾中導入所有模塊
執行時的命令
python -m pkg.tests.core_test #去最頂級執行
跨目錄級導入模塊
from ..xxfile import xxmodule #從上級目錄中的xxfile中導入xxmodule
import xxsub_dir.xxfile #從xxsub_dir文件夾中導入所有模塊
執行時的命令
python -m pkg.tests.core_test #去最頂級執行
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。