• Python3中开发目录的引用


    Python3中开发目录的引用

    import os,sys
    BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    sys.path.append(BASE_DIR)
    from conf import settings
    from core import main
    

      其中我的软件包中有bin、conf、core几个目录,下面有main.py、settings.py,将其导入至主函数中而已。。。

  • 相关阅读:
    2021/3/12
    2021/3/11
    2021/3/10
    2021/3/9
    2021/3/8
    2021/3/5
    2021/3/4
    2021/3/3
    2021/3/2
    2021/3/1
  • 原文地址:https://www.cnblogs.com/hjc4025/p/6513181.html
Copyright © 2020-2023  润新知