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

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

  •  
  •   cxl008 · 2015-04-01 15:25:15 +08:00 · 2507 次点击
    这是一个创建于 3284 天前的主题,其中的信息可能已经有所发展或是发生改变。
    贴代码

    # -*- 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 条回复    2015-04-05 12:33:20 +08:00
    ming2281
        1
    ming2281  
       2015-04-05 12:33:20 +08:00
    如果使用2.x,那么2.x的编码这个瑕疵会一直陪伴着你
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1000 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 19:54 · PVG 03:54 · LAX 12:54 · JFK 15:54
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.