zhuhaofeng

创建项目包

import os
os.makedirs(\'glance/bin\')
os.makedirs(\'glance/core\')
os.makedirs(\'glance/conf\')
os.makedirs(\'glance/db\')

open(\'glance/__init__.py\',\'w\').close()
open(\'glance/bin/__init__.py\',\'w\').close()
open(\'glance/bin/start.py\',\'w\').close()

open(\'glance/conf/__init__.py\',\'w\').close()
open(\'glance/conf/settings.py\',\'w\').close()

open(\'glance/core/__init__.py\',\'w\').close()
open(\'glance/core/main.py\',\'w\').close()
open(\'glance/core/search.py\',\'w\').close()

open(\'glance/db/__init__.py\',\'w\').close()
open(\'glance/db/staff_info\',\'w\').close()

要点总结:

       设计好目录结构后,创建的时候的应该一次成型,后面最好不要在修改目录结构和目录名。要不然会在导入包的过程中会出现各种报错,尤其在linux系统中,报错提示很少的情况下,更不容易定位错误

分类:

技术点:

相关文章: