from warnings import filterwarnings filterwarnings('ignore', category=警告类型)
from warnings import filterwarnings from pytz_deprecation_shim import PytzUsageWarning filterwarnings('ignore', category=PytzUsageWarning)
这样程序运行时,就不再显示PytzUsageWarning这种类型的警告了