首页 > 技术文章 > 调用日志输出错误:TypeError: 'int' object is not callable等

Gaoqiking 2019-06-27 09:42 原文

*)TypeError: 'int' object is not callable

 错误信息:
Traceback (most recent call last):
  File "Visualization_bubble_sort.py", line 81, in <module>
    plt,_=draw_chart(od)
  File "Visualization_bubble_sort.py", line 27, in draw_chart
    logging.INFO('%s'%frames[0:3])
TypeError: 'int' object is not callable

  原因,应该把INFO改为小写

 logging.info('%s'%frames[0:3])

 

*)TypeError: not all arguments converted during string formatting

  

    logging.warning('--draw_chart--message:frames[4][2]的颜色为:%s'%frames[2][2].color)#这里的frames[2][2].color是一个元组,所以可能与logging里的某些输出方式不符,这里改为
    logging.warning('--draw_chart--message:frames[4][2]的颜色为:%s'%str(frames[2][2].color))

  

 

推荐阅读