import arrow
last_month = arrow.now().shift(months=-1).format('MMM')
this_month = arrow.now().format('MMM')
print('last_month:',last_month)
print('this_month:',this_month)
month_int = arrow.now().format('M')
month_int = int(month_int)
print('month_int:',month_int)
print("当前季度是:", int((month_int - 1) / 3) + 1, "当前月份是:", month_int)
参考
https://arrow.readthedocs.io/en/latest/
https://www.programiz.com/python-programming/datetime/strftime