开发者

Why ActivePython freezes after I use the turtle module?

开发者 https://www.devze.com 2023-02-12 09:59 出处:网络
I\'ve installed ActivePython 3.1 and ran IDLE with -n parameter as required by the turtle module in documentation. However when I try to use it with call such as turtle.postion(), new windows is opene

I've installed ActivePython 3.1 and ran IDLE with -n parameter as required by the turtle module in documentation. However when I try to use it with call such as turtle.postion(), new windows is opened (with Tk icon), which fre开发者_Go百科ezes and shows nothing. What could be wrong?


The immediate cause of the freeze is that the Tk event loop is not being serviced. Without that, Tk windows do not display or update correctly (all GUI toolkits are event based, but Tk is particularly so). Unfortunately, I don't know Python's Tk binding or IDLE nearly well enough to be able to say what that is caused by.


Partially resolved by not running it in IDLE, I execute it as a python script and wait for input to see what is drawn.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号