首页
注册
登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请
登录
推荐学习书目
›
Learn Python the Hard Way
Python Sites
›
PyPI
- Python Package Index
›
http://diveintopython.org/toc/index.html
›
Pocoo
值得关注的项目
›
PyPy
›
Celery
›
Jinja2
›
Read the Docs
›
gevent
›
pyenv
›
virtualenv
›
Stackless Python
›
Beautiful Soup
›
结巴中文分词
›
Green Unicorn
›
Sentry
›
Shovel
›
Pyflakes
›
pytest
Python 编程
›
pep8 Checker
Styles
›
PEP 8
›
Google Python Style Guide
›
Code Style from The Hitchhiker's Guide
V2EX
›
Python
python2 中 import Tkinter 和 tkinter 什么区别?
oldbird
·
2024-03-18 13:52:53 +08:00
· 1096 次点击
这是一个创建于 379 天前的主题,其中的信息可能已经有所发展或是发生改变。
看教程都说 py2 应该用 import Tkinter ,试了下发现 import tkinter 也可以,请问这两种 import 在实际开发时是否有区别?
import
Tkinter
Tkinter
4 条回复
•
2024-03-18 19:43:37 +08:00
1
aloxaf
2024-03-18 14:00:10 +08:00
我猜是因为你的文件系统不区分大小写,你试一下 import TkIntER 是不是也没问题
2
oldbird
OP
2024-03-18 14:02:47 +08:00
@
aloxaf
不行,只能是 tkinter 或者 Tkinter 。Win10 系统,python 2.7.18 。
3
Tink
2024-03-18 14:05:55 +08:00
Python 2 里面 Tkinter 引入不区分大小写,3 不行,必须小写
4
ClericPy
2024-03-18 19:43:37 +08:00
python3 要做的就是消去这种歧义, 老版本问题忽略吧, 要么直接用 3 , 要么自己写好测试
关于
·
帮助文档
·
博客
·
API
·
FAQ
·
实用小工具
·
3785 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 25ms ·
UTC 10:24
·
PVG 18:24
·
LAX 03:24
·
JFK 06:24
Developed with
CodeLauncher
♥ Do have faith in what you're doing.