The approach I would use is to use loggingsetup as a sort of wrapper for logging.import logging# set up logging config herefrom logging import *然后在您的其他模块中:Then in your other modules you:import loggingsetup as logging在这种情况下,您可能想要使用 loggingsetup 以外的名称,例如tweaked_logging 或 logging_with_my_settings.You might want to use a name other than loggingsetup in this case, e.g. tweaked_logging or logging_with_my_settings. 这篇关于“未使用的导入警告"和皮林特的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 06-12 00:04