如何在python中按环境分组配置?

2024-06-16 09:56:28 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在从头开始开发一个复杂的ETL过程。该过程使用多处理和数据库查询以及SQLAlchemy。现在,我尝试添加一个文件环境配置,其中包括:

dev -> database config connection, folder where save temporal files, folder where save log files.
test -> another database config connection, another folder where save temporal files, another folder where save log files.

目前的项目结构是:

package_1
    some_module_1.py
    some_module_2.py
    main_process.py <-- Cron job will run it
package_2
    another_some_module_1.py
    another_main_process.py <-- Another Cron job will run it

在运行时(可能?),它将环境设置为获取配置集。 我怎么做?你有什么建议


Tags: pylogconfig环境过程saveanothersome