推荐学习书目
› 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
youthfire
V2EX  ›  Python

Python tkinter 按钮中输入 emoji 表情符号,会被重复显示

  •  
  •   youthfire · Sep 11, 2021 · 2052 views
    This topic created in 1853 days ago, the information mentioned may be changed or developed.

    本意是想给 tkinter 里的按钮增加 emoji 表情以便快速识别

    Button(root, text="明细查询", command=searchitem, font=("宋体", 15, 'bold')).grid(column=3, row=4)

    比如,在 text 这里增加一个 emoji 表情。添加后,表情可以显示出来,但任何表情都是会变成 2 个相同的。如果是只输入表情,不输入文字,就显示 2 个相同的表情。如果输入表情加文字,则文字会出现在 2 个重复表情的中间。如果不用 emoji 表情,用普通的 symbol 之类,可以正常显示。

    求教怎么解决?

    Supplement 1  ·  Dec 20, 2021
    确认是 tk 的 bug ,Python 更新到 3.10.1 以后,tk 采用 8.6.12 ,已经完美支持在 button 上显示 emoji 了,效果很好
    2 replies  •  2021-12-20 09:59:23 +08:00
    youthfire
        1
    youthfire  
    OP
       Sep 12, 2021
    在 Python 的 bug 报告处看到一些信息,大概率是 tcl/tk 处理 emoji 的能力问题
    https://bugs.python.org/issue44217
    youthfire
        2
    youthfire  
    OP
       Dec 20, 2021
    确认是 tk 的 bug ,Python 更新到 3.10.1 以后,tk 采用 8.6.12 ,已经完美支持在 button 上显示 emoji 了,效果很好
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3226 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 12:53 · PVG 20:53 · LAX 05:53 · JFK 08:53
    ♥ Do have faith in what you're doing.