#如下代码时,在pycharm中运行时,窗口在程序结束后,直接关闭,不能看到绘制的图像. 
#在python自带的IDE中,在执行代码后,可以看到窗口的显示。 

import turtle 
t = turtle.Pen() 
t.forward(50) 

#百度了一下:发现要想让窗口在pycharm中显示,不关闭,需要在最后加一句:turtle.done() ,即可,代码如下: 

import turtle 
t = turtle.Pen() 
t.forward(50) 
turtle.done() 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-16
  • 2022-01-12
  • 2022-12-23
  • 2022-01-20
猜你喜欢
  • 2022-12-23
  • 2022-01-04
  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
  • 2022-12-23
相关资源
相似解决方案