Python中文
首页
教程
问答
标签
搜索
登录
注册
python模块组织
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我正在编写一个python库来备份和组织科学数据。我们称之为<code>dataapp</code></p> <p>我想把我的目录安排如下:</p> <pre><code>core/ operations/ cli_interface.py </code></pre> <p>core包含所有数据类和数据存储库的类,所有代码都是独立的,没有依赖关系。操作包含所有操作,如保存、更新、备份数据,但操作依赖于核心。核心不是操作的子级,应该具有独立使用的能力。你知道吗</p> <p>然而,将代码从核心导入到操作中似乎是一件丑陋的事情,因为我必须从相对路径和父级导入。你知道吗</p> <p>导入的另一个选项是全局地在机器上安装<code>dataapp</code>,在这种情况下,操作可以很容易地从core导入。你知道吗</p> <p>我的问题是:上面的建议,还是有更好的方法来布局我的代码?你知道吗</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>你画的这个装置非常好。如果每个模块只允许从它自己的子模块导入(严格的树结构),那么就永远不能在模块之间共享代码。整洁的模块结构是有向无环图(没有相互导入),不一定是树。你知道吗</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
尽管Python中的所有内容都是引用,为什么Python导师在没有指针的列表中绘制字符串和整数?
9 回答
尽管python中的表达式为false,但循环仍在运行
6 回答
尽管python代码正确,但从nifi ExecuteScript处理器获取语法错误
2 回答
尽管Python在Neovim中工作得很好,但插件不能识别Neovim中的Python主机
4 回答
尽管python字典包含了大量的条目,但它并没有增长
6 回答
尽管python说模块存在,为什么我会得到这个消息?
4 回答
尽管setuptools和控制盘是最新的,但无法识别singleversionexternallymanaged
2 回答
尽管stdout和stderr重定向,但未捕获错误消息
9 回答
尽管Tensorboard的事件太大,但Tensorboard的步骤太少了
7 回答
尽管tkinter上的变量已更改,但显示未更改
6 回答
尽管try/except使用Python进行单元测试时出现断言错误
9 回答
尽管URL是sam,但仍会抛出“达到最大重定向”
8 回答
尽管url有效,Pandas仍读取url的\u csv错误
7 回答
尽管while中存在时间延迟,但LINUX线程的CPU利用率为100%(1)
3 回答
尽管x0在范围内,Scipy优化仍会引发ValueError
9 回答
尽管xpath正确,但使用selenium单击链接仍不起作用
4 回答
尽管下载了ffmpeg并设置了路径变量python,但没有后端错误
7 回答
尽管下载了i,但找不到型号“fr”
6 回答
尽管下载了plotnine包,但未获取名为“plotnine”的模块时出错
2 回答
尽管为所有行指定了权重,网格(0)仍不起作用
4 回答