python
小鱼干的大猫粮
这个作者很懒,什么都没留下…
展开
-
Pyhotn 中编码的问题:'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)的错误
Python中字符串类型分为byte string 和 unicode string两种。如果在python文件中指定编码方式为utf-8(#coding=utf-8),那么所有带中文的字符串都会被认为是utf-8编码的byte string(例如:mystr="你好"),但是在函数中所产生的字符串则被认为是unicode string。 问题就出在这边,unicode string...转载 2018-04-11 10:30:12 · 1939 阅读 · 0 评论 -
python读取数据库报错ORA-29275部分多字节字符
try: sql_sw="select c1 from bd_t_sfsjpp_sw_temp t order by to_number(t.num) db=cx_Oracle.connect('***/***@192.168.2.101:***/orcl') print "连接数据库成功" cursorSeq=db.cursor() cursorSeq.execu...原创 2018-04-18 17:02:43 · 1469 阅读 · 0 评论