V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
cxl008
V2EX  ›  Python

无奈的 mac+丑陋的 tk 。。求助

  •  
  •   cxl008 · Apr 1, 2015 · 3109 views
    This topic created in 4056 days ago, the information mentioned may be changed or developed.
    贴代码

    # -*- coding: utf-8 -*-
    from Tkinter import *
    root=Tk()


    root.title('My Demo')
    Label(root,text='请输入姓名').pack()
    t=Text(root,width=30,height=1)
    t.pack()
    e=StringVar()
    e.set('Enter your name')
    entry=Entry(root,textvariable=e).pack()

    def EveButton():
    print e.get()

    Button(root,text='确定',command=EveButton).pack()
    root.mainloop()




    mac 下运行,输入框里面 , 不管咋切换输入法都没用,怎么能输入中文? win和ubuntu测试是可以的输入出中文的。。。
    1 replies    2015-04-05 12:33:20 +08:00
    ming2281
        1
    ming2281  
       Apr 5, 2015
    如果使用2.x,那么2.x的编码这个瑕疵会一直陪伴着你
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3052 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 04:08 · PVG 12:08 · LAX 21:08 · JFK 00:08
    ♥ Do have faith in what you're doing.