- 論壇徽章:
- 0
|
#python
>a = "我愛你"
>print a
"我愛你"
好像沒錯(cuò)的.
但是...
- #!/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()
復(fù)制代碼
也能正常運(yùn)行...不過有個(gè)錯(cuò)誤:
[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
后來看了那個(gè)網(wǎng)zhi, 在里面添個(gè):
# -*- coding: utf-8 -*-
就好了 
本來不想帖...不過寫了那么多...
決定以后界面用python寫o...非常方便. |
|