拿着本python的书翻翻, 随手试一下程序竟然出错, 原来python 3.x和原来的2.x改了一些东西,让初学者郁闷啊。

1、print在3.x中成了函数, 要写成print(...)

 

2、使用Tkinter的时候, 2.x 写成  from Tkinter import * 。  但是在3.x中就会出错, 需要写成

 

     from tkinter import *

 

3、thread模块的名称被修改为_thread, 所以import thread出错, 要改成import _thread

 

相关文章:

  • 2021-09-15
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
  • 2020-01-18
  • 2021-09-05
  • 2022-12-23
  • 2021-10-16
猜你喜欢
  • 2021-04-17
  • 2021-11-24
  • 2022-12-23
  • 2021-10-06
  • 2021-10-07
  • 2021-09-18
  • 2021-09-17
相关资源
相似解决方案