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
oldbird
V2EX  ›  Python

python2 中 import Tkinter 和 tkinter 什么区别?

  •  
  •   oldbird · 40 天前 · 771 次点击
    这是一个创建于 40 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    4 条回复    2024-03-18 19:43:37 +08:00
    aloxaf
        1
    aloxaf  
       40 天前
    我猜是因为你的文件系统不区分大小写,你试一下 import TkIntER 是不是也没问题
    oldbird
        2
    oldbird  
    OP
       40 天前
    @aloxaf 不行,只能是 tkinter 或者 Tkinter 。Win10 系统,python 2.7.18 。
    Tink
        3
    Tink  
       40 天前
    Python 2 里面 Tkinter 引入不区分大小写,3 不行,必须小写
    ClericPy
        4
    ClericPy  
       40 天前
    python3 要做的就是消去这种歧义, 老版本问题忽略吧, 要么直接用 3 , 要么自己写好测试
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1102 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 18:23 · PVG 02:23 · LAX 11:23 · JFK 14:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.