[英]Git Best Practice: How to structure multiple python modules needed for one large app
[英]Python large app: how to use other modules that might be needed or not, depending on the request given?
我在python中有一個Web應用程序,並且有一個主文件是路由器。
路由器讀取路徑並應該:
在第一種情況下:
router(path, args):
// now import the module needed and run it
在第二種情況下,應用程序看起來像:
from services.a import a1
from services.a import a2
from services.a import a3
from services.a import a4
from services.a import a5
from services.a import a6
// and then in the router function
rooter(path, args):
// based on the path will call a fn
a1(args...)
什么是更好的?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.