python: why IDLE is slower than terminal?

核能气质少年 提交于 2019-12-14 03:50:05

问题


I just wrote a simple python command to check on a big list from a csv file. The csv has 2 columns with 10K lines. when I input the 2nd row into a list and later print the list, it takes the IDLE quite some time to show it where the terminal (under mac) shows it promptly. *BTW, I checked it on 2 different machines - same result.

Obviously, no one will print 10k items on a console but the idea that one is significantly faster than the other makes me wonder: why IDLE which supposed to be python's best friend is so slow?


回答1:


The bulk of the problem is in how IDLE handles printing of text to the output window; try commenting out the print statement and see if the performance gap remains. See this closely related thread: Python: Why is IDLE so slow?



来源:https://stackoverflow.com/questions/12851313/python-why-idle-is-slower-than-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!