Python论坛  - 讨论区

标题:[python-chinese] Qt将使用GPLv3

2008年01月21日 星期一 14:11

刀巴虫子 acestrong在gmail.com
星期一 一月 21 14:11:18 HKT 2008

原文链接:
http://labs.trolltech.com/blogs/2008/01/19/qt-3-and-4-licensed-under-gplv3/
以后可以更放心的使用了~~
-- 
Best Regards!

Ace Strong

==================================================
Nanjing University of Aeronautics and Astronautics.
College of Civil Aviation
Tao Cheng
E-mail: acestrong在gmail.com ;acestrong在nuaa.edu.cn
Tel: 86-025-84892273
==================================================
-------------- 下一部分 --------------
一个HTML附件被移除...
URL: http://python.cn/pipermail/python-chinese/attachments/20080121/36703f9e/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月21日 星期一 14:26

Zoom.Quiet zoom.quiet在gmail.com
星期一 一月 21 14:26:21 HKT 2008

On Jan 21, 2008 2:11 PM, 刀巴虫子 <acestrong在gmail.com> wrote:
> 原文链接:http://labs.trolltech.com/blogs/2008/01/19/qt-3-and-4-licensed-under-gplv3/
> 以后可以更放心的使用了~~
 是也乎,外部条件成熟,可以学习Qt 的GUI 开发了 ;)

> --
> Best Regards!
>
> Ace Strong
>
> ==================================================
> Nanjing University of Aeronautics and Astronautics.
> College of Civil Aviation
> Tao Cheng
> E-mail: acestrong在gmail.com ;acestrong在nuaa.edu.cn
> Tel: 86-025-84892273
> ==================================================
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>



-- 
'''Time is unimportant, only life important!
过程改进乃是开始催生可促生靠谱的人的组织!
'''http://zoomquiet.org
博 @ http://blog.zoomquiet.org/pyblosxom/
维 @ http://wiki.woodpecker.org.cn/moin/ZoomQuiet
豆 @ http://www.douban.com/people/zoomq/
看 @ http://zoomq.haokanbu.com/
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Pls. usage OOo to replace M$ Office. http://zh.openoffice.org
Pls. usage 7-zip to replace WinRAR/WinZip.  http://7-zip.org
You can get the truely Freedom 4 software.

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月21日 星期一 14:30

lai yonghao lanphaday在gmail.com
星期一 一月 21 14:30:42 HKT 2008

°® wx µÄ pythoner Æ®¹ý¡£

ÔÚ08-1-21£¬Zoom. Quiet <zoom.quiet在gmail.com> дµÀ£º
>
> On Jan 21, 2008 2:11 PM, µ¶°Í³æ×Ó <acestrong在gmail.com> wrote:
> > Ô­ÎÄÁ´½Ó£º
> http://labs.trolltech.com/blogs/2008/01/19/qt-3-and-4-licensed-under-gplv3/
> > ÒÔºó¿ÉÒÔ¸ü·ÅÐĵÄʹÓÃÁË¡«¡«
> ÊÇÒ²ºõ£¬ÍⲿÌõ¼þ³ÉÊ죬¿ÉÒÔѧϰQt µÄGUI ¿ª·¢ÁË ;)
>
> > --
> > Best Regards£¡
> >
> > Ace Strong
> >
> > ==================================================
> > Nanjing University of Aeronautics and Astronautics.
> > College of Civil Aviation
> > Tao Cheng
> > E-mail: acestrong在gmail.com ;acestrong在nuaa.edu.cn
> > Tel: 86-025-84892273
> > ==================================================
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
>
>
>
> --
> '''Time is unimportant, only life important!
> ¹ý³Ì¸Ä½øÄËÊÇ¿ªÊ¼´ßÉú¿É´ÙÉú¿¿Æ×µÄÈ˵Ä×éÖ¯!
> '''http://zoomquiet.org
> ²© @ http://blog.zoomquiet.org/pyblosxom/
> ά @ http://wiki.woodpecker.org.cn/moin/ZoomQuiet
> ¶¹ @ http://www.douban.com/people/zoomq/
> ¿´ @ http://zoomq.haokanbu.com/
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Pls. usage OOo to replace M$ Office. http://zh.openoffice.org
> Pls. usage 7-zip to replace WinRAR/WinZip.  http://7-zip.org
> You can get the truely Freedom 4 software.
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20080121/68fdcc01/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月21日 星期一 14:41

fluke.l fluke.l在gmail.com
星期一 一月 21 14:41:17 HKT 2008

ϲ»¶Qt°¡¡£ÏÖÔÚ·ÅÐÄÁË¡£


2008-01-21 



fluke.l 



·¢¼þÈË£º Zoom.Quiet 
·¢ËÍʱ¼ä£º 2008-01-21  14:28:34 
ÊÕ¼þÈË£º python-chinese在lists.python.cn; Python.cn在google; pythontw在googlegroups.com; cpug-eastchina在googlegroups.com; zpug在googlegroups.com 
³­ËÍ£º 
Ö÷Ì⣺ Re: [python-chinese]Qt½«Ê¹ÓÃGPLv3 
 
On Jan 21, 2008 2:11 PM, µ¶°Í³æ×Ó <acestrong在gmail.com> wrote:
> Ô­ÎÄÁ´½Ó£ºhttp://labs.trolltech.com/blogs/2008/01/19/qt-3-and-4-licensed-under-gplv3/
> ÒÔºó¿ÉÒÔ¸ü·ÅÐĵÄʹÓÃÁË¡«¡«
 ÊÇÒ²ºõ£¬ÍⲿÌõ¼þ³ÉÊ죬¿ÉÒÔѧϰQt µÄGUI ¿ª·¢ÁË ;)
> --
> Best Regards£¡
>
> Ace Strong
>
> ==================================================
> Nanjing University of Aeronautics and Astronautics.
> College of Civil Aviation
> Tao Cheng
> E-mail: acestrong在gmail.com ;acestrong在nuaa.edu.cn
> Tel: 86-025-84892273
> ==================================================
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
-- 
'''Time is unimportant, only life important!
¹ý³Ì¸Ä½øÄËÊÇ¿ªÊ¼´ßÉú¿É´ÙÉú¿¿Æ×µÄÈ˵Ä×éÖ¯!
'''http://zoomquiet.org
²© @ http://blog.zoomquiet.org/pyblosxom/
ά @ http://wiki.woodpecker.org.cn/moin/ZoomQuiet
¶¹ @ http://www.douban.com/people/zoomq/
¿´ @ http://zoomq.haokanbu.com/
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Pls. usage OOo to replace M$ Office. http://zh.openoffice.org
Pls. usage 7-zip to replace WinRAR/WinZip.  http://7-zip.org
You can get the truely Freedom 4 software.
_______________________________________________
python-chinese
Post: send python-chinese在lists.python.cn
Subscribe: send subscribe to python-chinese-request在lists.python.cn
Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
Detail Info: http://python.cn/mailman/listinfo/python-chinese
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20080121/267e4f3c/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月21日 星期一 15:33

Joey tang.jiyu在gmail.com
星期一 一月 21 15:33:35 HKT 2008

QT, wx¶¼Ï²»¶£¬Ñ§Ï°ÖÐ

2008/1/21 fluke.l <fluke.l在gmail.com>:

>  ϲ»¶Qt°¡¡£ÏÖÔÚ·ÅÐÄÁË¡£
>
>
> 2008-01-21
> ------------------------------
>  fluke.l
> ------------------------------
> *·¢¼þÈË£º* Zoom.Quiet
> *·¢ËÍʱ¼ä£º* 2008-01-21  14:28:34
> *ÊÕ¼þÈË£º* python-chinese在lists.python.cn; Python.cn在google;
> pythontw在googlegroups.com; cpug-eastchina在googlegroups.com;
> zpug在googlegroups.com
> *³­ËÍ£º*
> *Ö÷Ì⣺* Re: [python-chinese]Qt½«Ê¹ÓÃGPLv3
>    On Jan 21, 2008 2:11 PM, µ¶°Í³æ×Ó <acestrong在gmail.com> wrote:
> > Ô­ÎÄÁ´½Ó£º
> http://labs.trolltech.com/blogs/2008/01/19/qt-3-and-4-licensed-under-gplv3/
> > ÒÔºó¿ÉÒÔ¸ü·ÅÐĵÄʹÓÃÁË¡«¡«
>  ÊÇÒ²ºõ£¬ÍⲿÌõ¼þ³ÉÊ죬¿ÉÒÔѧϰQt µÄGUI ¿ª·¢ÁË ;)
>  > --
> > Best Regards£¡
> >
> > Ace Strong
> >
> > ==================================================
> > Nanjing University of Aeronautics and Astronautics.
> > College of Civil Aviation
> > Tao Cheng
> > E-mail: acestrong在gmail.com ;acestrong在nuaa.edu.cn
> > Tel: 86-025-84892273
> > ==================================================
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
>   --
> '''Time is unimportant, only life important!
> ¹ý³Ì¸Ä½øÄËÊÇ¿ªÊ¼´ßÉú¿É´ÙÉú¿¿Æ×µÄÈ˵Ä×éÖ¯!
> '''http://zoomquiet.org
> ²© @ http://blog.zoomquiet.org/pyblosxom/
> ά @ http://wiki.woodpecker.org.cn/moin/ZoomQuiet
> ¶¹ @ http://www.douban.com/people/zoomq/
> ¿´ @ http://zoomq.haokanbu.com/
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Pls. usage OOo to replace M$ Office. http://zh.openoffice.org
> Pls. usage 7-zip to replace WinRAR/WinZip.  http://7-zip.org
> You can get the truely Freedom 4 software.
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>



-- 
Best Regard,
Tang, Jiyu (Joey)
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20080121/72212118/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]
zy

zy

2008年01月21日 星期一 16:09

Lich_Ray solo.lich在gmail.com
星期一 一月 21 16:09:59 HKT 2008

°®GTKµÄ *er Æ®¹ý¡£

ÔÚ08-1-21£¬lai yonghao <lanphaday在gmail.com> дµÀ£º
>
> °® wx µÄ pythoner Æ®¹ý¡£
>
> ÔÚ08-1-21£¬Zoom. Quiet <zoom.quiet在gmail.com> дµÀ£º
> >
> > On Jan 21, 2008 2:11 PM, µ¶°Í³æ×Ó <acestrong在gmail.com> wrote:
> > > Ô­ÎÄÁ´½Ó£º
> > http://labs.trolltech.com/blogs/2008/01/19/qt-3-and-4-licensed-under-gplv3/
> > > ÒÔºó¿ÉÒÔ¸ü·ÅÐĵÄʹÓÃÁË¡«¡«
> > ÊÇÒ²ºõ£¬ÍⲿÌõ¼þ³ÉÊ죬¿ÉÒÔѧϰQt µÄGUI ¿ª·¢ÁË ;)
> >
> > > --
> > > Best Regards£¡
> > >
> > > Ace Strong
> > >
> > > ==================================================
> > > Nanjing University of Aeronautics and Astronautics.
> > > College of Civil Aviation
> > > Tao Cheng
> > > E-mail: acestrong在gmail.com ;acestrong在nuaa.edu.cn
> > > Tel: 86-025-84892273
> > > ==================================================
> > > _______________________________________________
> > > python-chinese
> > > Post: send python-chinese在lists.python.cn
> > > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > > Unsubscribe: send unsubscribe to
> > python-chinese-request在lists.python.cn
> > > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> > >
> >
> >
> >
> > --
> > '''Time is unimportant, only life important!
> > ¹ý³Ì¸Ä½øÄËÊÇ¿ªÊ¼´ßÉú¿É´ÙÉú¿¿Æ×µÄÈ˵Ä×éÖ¯!
> > '''http://zoomquiet.org
> > ²© @ http://blog.zoomquiet.org/pyblosxom/
> > ά @ http://wiki.woodpecker.org.cn/moin/ZoomQuiet
> > ¶¹ @ http://www.douban.com/people/zoomq/
> > ¿´ @ http://zoomq.haokanbu.com/
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > Pls. usage OOo to replace M$ Office. http://zh.openoffice.org
> > Pls. usage 7-zip to replace WinRAR/WinZip.  http://7-zip.org
> > You can get the truely Freedom 4 software.
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>



-- 
Ray Stinger, nickname Lich_Ray
God is in his heaven, all's right with the world.
-------------------------------------------------
let focus = 'computing' in where:
http://lichray.javaeye.com
let focus = 'computing' in here:
http://inblogs.net/let-in
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20080121/79e46ebf/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月21日 星期一 16:12

Jiahua Huang jhuangjiahua在gmail.com
星期一 一月 21 16:12:05 HKT 2008

楼上的, 好像上回贴 PyGtk 的问题你也一样漂过

2008/1/21 Lich_Ray <solo.lich at gmail.com>:
> 爱GTK的 *er 飘过。
>

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]
zy

zy

2008年01月21日 星期一 16:33

Lich_Ray solo.lich在gmail.com
星期一 一月 21 16:33:47 HKT 2008

ÄǸö½Ð"×ß¹ý"£¬²»½Ð"Æ®¹ý"¡£

2008/1/21, Jiahua Huang <jhuangjiahua在gmail.com>:
>
> Â¥ÉϵÄ, ºÃÏñÉÏ»ØÌù PyGtk µÄÎÊÌâÄãÒ²Ò»ÑùƯ¹ý
>
> 2008/1/21 Lich_Ray <solo.lich在gmail.com>:
> > °®GTKµÄ *er Æ®¹ý¡£
> >
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese




-- 
Ray Stinger, nickname Lich_Ray
God is in his heaven, all's right with the world.
-------------------------------------------------
let focus = 'computing' in where:
http://lichray.javaeye.com
let focus = 'computing' in here:
http://inblogs.net/let-in
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20080121/54219c45/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月21日 星期一 17:10

李李 py.7在163.com
星期一 一月 21 17:10:02 HKT 2008

最近在写些操作mysql数据的东西,发现写出来后windows下运行正常,但只要迁到debian环境下就无法查询带有中文的数据库了;

conn = MySQLdb.connect(host = host, db=db, user=user,
              passwd=passwd, use_unicode=1, charset='utf8')
cursor = conn.cursor()
query = "select * from tab where su = '待'"
cursor.execute(query)
row1=cursor.fetchall()

错误信息:
  File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py", line 147, in execute
    query = query.encode(charset)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb4 in position 35: ordinal not in range(128)


各位高手,这个是为什么啊?


也试过把 MySQLdb的cursor。execute改成
def execute(self, query, char="utf-8", args=None):
	charset = char
    query = query.encode(charset)

最终还是不行,数据库切切实实是utf8的啊。
	
= = = = = = = = = = = = = = = = = = = =
			

        致
礼!
 



李李
2008-01-21



[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月21日 星期一 17:16

李李 py.7在163.com
星期一 一月 21 17:16:20 HKT 2008

最近在写些操作mysql数据的东西,发现写出来后windows下运行正常,但只要迁到debian环境下就无法查询带有中文的数据库了;

conn = MySQLdb.connect(host = host, db=db, user=user,
              passwd=passwd, use_unicode=1, charset='utf8')
cursor = conn.cursor()
query = "select * from tab where su = '待'"
cursor.execute(query)
row1=cursor.fetchall()

错误信息:
  File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py", line 147, in execute
    query = query.encode(charset)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb4 in position 35: ordinal not in range(128)


各位高手,这个是为什么啊?


也试过把 MySQLdb的cursor。execute改成
def execute(self, query, char="utf-8", args=None):
	charset = char
    query = query.encode(charset)

最终还是不行,数据库切切实实是utf8的啊。
	
= = = = = = = = = = = = = = = = = = = =
			

        致
礼!
 



李李
2008-01-21


_______________________________________________
listinfo/python-chinese

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月21日 星期一 17:18

李李 py.7在163.com
星期一 一月 21 17:18:28 HKT 2008

最近在写些操作mysql数据的东西,发现写出来后windows下运行正常,但只要迁到debian环境下就无法查询带有中文的数据库了;

conn = MySQLdb.connect(host = host, db=db, user=user,
              passwd=passwd, use_unicode=1, charset='utf8')
cursor = conn.cursor()
query = "select * from tab where su = '待'"
cursor.execute(query)
row1=cursor.fetchall()

错误信息:
  File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py", line 147, in execute
    query = query.encode(charset)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb4 in position 35: ordinal not in range(128)


各位高手,这个是为什么啊?


也试过把 MySQLdb的cursor。execute改成
def execute(self, query, char="utf-8", args=None):
	charset = char
    query = query.encode(charset)

最终还是不行,数据库切切实实是utf8的啊。
	
= = = = = = = = = = = = = = = = = = = =
			

        致
礼!
 



李李
2008-01-21



[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月21日 星期一 17:37

Jiahua Huang jhuangjiahua在gmail.com
星期一 一月 21 17:37:36 HKT 2008

在你代码开头加

import sys
reload(sys)
sys.setdefaultencoding('utf8')


2008/1/21 李李 <py.7 at 163.com>:
>
> 最近在写些操作mysql数据的东西,发现写出来后windows下运行正常,但只要迁到debian环境下就无法查询带有中文的数据库了;
>
> conn = MySQLdb.connect(host = host, db=db, user=user,
>               passwd=passwd, use_unicode=1, charset='utf8')
> cursor = conn.cursor()
> query = "select * from tab where su = '待'"
> cursor.execute(query)
> row1=cursor.fetchall()
>
> 错误信息:
>   File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py", line 147, in execute
>     query = query.encode(charset)
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xb4 in position 35: ordinal not in range(128)
>
>
> 各位高手,这个是为什么啊?
>
>
> 也试过把 MySQLdb的cursor。execute改成
> def execute(self, query, char="utf-8", args=None):
>         charset = char
>     query = query.encode(charset)
>
> 最终还是不行,数据库切切实实是utf8的啊。
>
> = = = = = = = = = = = = = = = = = = = =
>
>
>> 礼!
>
>
>
>
> 李李
> 2008-01-21
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月21日 星期一 17:38

leopay leopay在gmail.com
星期一 一月 21 17:38:34 HKT 2008

2008/1/21 ÀîÀî <py.7在163.com>:

>
> ×î½üÔÚдЩ²Ù×÷mysqlÊý¾ÝµÄ¶«Î÷£¬·¢ÏÖд³öÀ´ºówindowsÏÂÔËÐÐÕý³££¬µ«Ö»ÒªÇ¨µ½debian»·¾³Ï¾ÍÎÞ·¨²éѯ´øÓÐÖÐÎĵÄÊý¾Ý¿âÁË£»
>
> conn = MySQLdb.connect(host = host, db=db, user=user,
>              passwd=passwd, use_unicode=1, charset='utf8')
> cursor = conn.cursor()




>
> query = "select * from tab where su = '´ý'"
> cursor.execute(query)


cursor.execute('select * from tab where su=%s','´ý')

>
> row1=cursor.fetchall()
>
> ´íÎóÐÅÏ¢£º
>  File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py", line 147, in
> execute
>    query = query.encode(charset)
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xb4 in position 35:
> ordinal not in range(128)
>
>
> ¸÷λ¸ßÊÖ£¬Õâ¸öÊÇΪʲô°¡£¿
>
>
> Ò²ÊÔ¹ý°Ñ MySQLdbµÄcursor¡£execute¸Ä³É
> def execute(self, query, char="utf-8", args=None):
>        charset = char
>    query = query.encode(charset)
>
> ×îÖÕ»¹ÊDz»ÐУ¬Êý¾Ý¿âÇÐÇÐʵʵÊÇutf8µÄ°¡¡£
>
> = = = = = = = = = = = = = = = = = = = =
>
>
> ÖÂ
> Àñ£¡
>
>
>
>
> ˔˔
> 2008-01-21
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20080121/a111a62c/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2008年01月21日 星期一 17:39

kongxiangbo 孔祥波 py.konger在gmail.com
星期一 一月 21 17:39:42 HKT 2008

首先确定你的.py文件的编码是不是utf-8,另外文件头需要code--utf-8

在 08-1-21,李李<py.7在163.com> 写道:
>
> 最近在写些操作mysql数据的东西,发现写出来后windows下运行正常,但只要迁到debian环境下就无法查询带有中文的数据库了;
>
> conn = MySQLdb.connect(host = host, db=db, user=user,
>               passwd=passwd, use_unicode=1, charset='utf8')
> cursor = conn.cursor()
> query = "select * from tab where su = '待'"
> cursor.execute(query)
> row1=cursor.fetchall()
>
> 错误信息:
>   File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py", line 147, in execute
>     query = query.encode(charset)
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xb4 in position 35: ordinal not in range(128)
>
>
> 各位高手,这个是为什么啊?
>
>
> 也试过把 MySQLdb的cursor。execute改成
> def execute(self, query, char="utf-8", args=None):
>         charset = char
>     query = query.encode(charset)
>
> 最终还是不行,数据库切切实实是utf8的啊。
>
> = = = = = = = = = = = = = = = = = = = =
>
>
>> 礼!
>
>
>
>
> 李李
> 2008-01-21
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2024

    京ICP备05028076号