• python创建项目包


    创建项目包

    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系统中,报错提示很少的情况下,更不容易定位错误

  • 相关阅读:
    网站图片轮播效果
    图片处理类
    字符串处理帮助类
    css3高级选择器
    JQuery选择器大全
    ASCII码表
    jQuery选择器大全
    OpenFileDialog无法弹出的解决方法
    socket学习目录
    ps-抠图
  • 原文地址:https://www.cnblogs.com/zhuhaofeng/p/9524623.html
Copyright © 2020-2023  润新知