python2 中 import Tkinter 和 tkinter 什么区别?

52 天前
 oldbird

看教程都说 py2 应该用 import Tkinter ,试了下发现 import tkinter 也可以,请问这两种 import 在实际开发时是否有区别?

792 次点击
所在节点    Python
4 条回复
aloxaf
52 天前
我猜是因为你的文件系统不区分大小写,你试一下 import TkIntER 是不是也没问题
oldbird
52 天前
@aloxaf 不行,只能是 tkinter 或者 Tkinter 。Win10 系统,python 2.7.18 。
Tink
52 天前
Python 2 里面 Tkinter 引入不区分大小写,3 不行,必须小写
ClericPy
52 天前
python3 要做的就是消去这种歧义, 老版本问题忽略吧, 要么直接用 3 , 要么自己写好测试

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1024705

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX