- 论坛徽章:
- 0
|
#python
>a = "我爱你"
>print a
"我爱你"
好像没错的.
但是...
- #!/usr/bin/python
- import pygtk
- pygtk.require('2.0')
- import gtk
- class test:
- def __init__(self):
- self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
- self.window.connect_object("destroy", gtk.main_quit, self.window)
- self.window.set_title("我爱你");
- self.window.show()
- if __name__ == "__main__":
- t = test()
- gtk.main()
复制代码
也能正常运行...不过有个错误:
[yarco@localhost py]$ ./1.py
sys:1: DeprecationWarning: Non-ASCII character 'xe6' in file ./1.py on line 11, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
后来看了那个网zhi, 在里面添个:
# -*- coding: utf-8 -*-
就好了 
本来不想帖...不过写了那么多...
决定以后界面用python写o...非常方便. |
|