Python Êý×ÖÓë×Ö·û´®Á¬½ÓÎÊÌâ
¶¨ÒåÏÂÃæÕâÑùÒ»¸öº¯Êý£¬½«excel±í¸ñÖÐÁ½¸öµ¥Ôª¸ñµÄÄÚÈÝÁ¬³ÉÒ»¸ö×Ö·û´®£¬µ«ÊÇÈç¹ûǰһ¸öµ¥Ôª¸ñµÄÄÚÈÝÊÇÊý×Ö£¬±ÈÈçÊÇ¡°1¡±£¬ºóÒ»¸öµ¥Ôª¸ñµÄÊÂ×Ö·û´®£¬¾Í»á±¨´íunsupported operand type(s) for +=: 'float' and 'unicode'¡£def GetSection(index):
section = sheet.cell_value(index,6)
section += sheet.cell_value(index,8)
return section
Èç¹ûÔÚ ¡°+=¡± ²Ù×÷Ç°Ãæ¼ÓÒ»¾ä str(section)
Óֻᱨ´íascii' codec can't encode character u'\u5168' in position 0: ordinal not in range(128)
ÇëÎÊÈçºÎ½â¾ö
ÀûÓÃunicode À´Ç¿ÖÆ×ª³É×Ö·û´®ÊÔÊÔ
section += unicode(sheet.cell_value(index,8))
ËäÈ»PythonÊǶ¯Ì¬ÓïÑÔ£¬µ«PythonÖеĶÔÏóÊÇÇ¿ÀàÐ͵ģ¬int Óë strÐ͵ĶÔÏóµ±È»²»ÄÜÌí¼Ó¡£
return ('%s%d' %(sheet.cell_value(index,6),sheet.cell_value(index,8)))
Õâ¸ö¿ÉÒÔ²»
Õâ¸öÓ¦¸Ã¿ÉÒÔ°É¡£²»¹ý£¬Èç¹û±àÂë²»¶ÔµÄ»°£¬»¹ÊÇ»á³öÏÖÂÒÂëµÄ¡£
ѧϰ....
³ÌÐòÖбàÂëҪͳһŶ
²»È»ÒÔºóºÜÂé·³µÄ
ÕâÊǸö±àÂëÎÊÌ⣬EXCELÀï×Ö·û´®¶¼ÊÇUNICODE£¬Êý×Ö¾ÍÊÇÊýÖµÀàÐÍ£¬Á½¸ö±äÁ¿Ïà¼Ó֮ǰ£¬½«ÊýÖµÀàÐÍÇ¿ÖÆ×ª»»ÎªUNICODEÀàÐͼ´¿É£¬¿´ÏÂÏà¹ØµÄ×ÊÁϾÍÐÐÁË
def InsertCode5(cursor,code,address,section):
t = (code,address,section,)
cursor.execute('insert into TBL_CODE_5 values (?,?,?)', t)
½â決ÁË£¬謝謝´ó¼ÒÖ§³Ö
Ïà¹ØÎÊ´ð£º
ÒÑÖªPython ÖУº
s = unicode("²âÊÔ", "gb2312")
s = u'\u6d4b\u8bd5'
print s
²âÊÔ
ÔÚDelphiÀïÃæÈçºÎ½«\u6d4b\u8bd5ÕâÑùµÄ»¹Ô³ÉGb2312µÄºº×ÖÄØ£¿
ÕÒµ½¸ö·½·¨
......
ËÍÆ¼öÒ»±¾Ñ§Ï°PYTHONµÄÊ飬лл
¡¶python¼òÃ÷½Ì³Ì¡·£¬¡¶pythonºËÐıà³Ì¡·
×÷Ϊϵͳ¹ÜÀí·½Ãæ£¬¡¶Python UNIXºÍLinuxϵͳ¹ÜÀíÖ¸ÄÏ¡·ÊDZ¾·Ç³£²»´íµÄÊé¡£
http://club.book.csdn.net/pic3/255142.jpg
ÒýÓÃ
×÷Î ......
C#ÀïÃæÓÃusing System.Security.Cryptography; RSACryptoServiceProvider¼ÓÃܹýµÄÏûÏ¢
ÓÃPython CryptoÖÐRSAµÄ·½·¨ ÄÜÖ±½Ó ½âÂð£¿
RSA¼ÓÃÜ·½Ê½²»ÊÇͳһµÄÂð£¿ÐèҪעÒâЩʲô£¿
ÓаïÖú¡£µ«ÊÇû½â¾öÎÊÌâ¡£¡£¡£
......
map£¬filter·½·¨Ó¦¸Ã»á·µ»ØÒ»¸öÁÐ±í¡£
µ«ÊÇÔÚÎÒÕâÀËüÃÇ×ÜÊÇ·µ»Ø£º
<map object at 0x0000000002A2C978>
<filter object at 0x0000000002A2C9E8>
ÎÒÓõÄpython3.1£¬ Õâ¸öÒ²Êǰ汾µÄ±ä¶¯µ¼ÖµÄÂ𣿠......
Traceback (most recent call last):
File "C:\test.py", line 80, in <module>
cur.execute("update userdata set kb=0 where strAccountID='%s'" % name)
......