Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÓÃpythonʵÏÖcrc32Çó×Ö·û´®Ð£ÑéÂë


תÌû£º
http://blog.csdn.net/wyingquan/archive/2008/12/20/3561094.aspx
ÓÃpython×Ô´øµÄbinasciiÄ£¿é¼ÆËã×Ö·û´®µÄУÑéÂ룬³öÀ´µÄÊǸºÖµ£¬ÓëÓÃcдµÄ³ÌÐòµÃ³öµÄУÑéÂë²»Ò»Ñù£¬ËùÒÔ¾ÍÑо¿ÁËһϡ£·¢ÏÖ±ðÈËÓõÄpython3.0°æ±¾binasciiÄ£¿é¼ÆËã³öµÄcrc32УÑéÂëÊÇÎÒÏëÒªµÄ£¬Ã»°ì·¨Ö»ºÃ×Ô¼ºÓÃpythonʵÏÖÒ»ÏÂcrc32µÄËã·¨ÁË¡£·¢ÏÖËã·¨ºÜ¼òµ¥£¬¾ÍÊÇijЩʵÏÖÀïÃæŪÁ˺ü¸¸öº¯Êýµ¹¸ã¸´ÔÓÁË£¬Æäʵ°´ºËÐÄËã·¨Ëã·¨×ßÒ»±ßºÜÈÝÒ×¾ÍÀí½âºÍÓ¦ÓÃÁË¡£
ÒòΪֱ½Ó´Óc³ÌÐòת¹ýÀ´µÄ£¬½á¹û·¢ÏÖpython2.5£¨ÎÒÓõİ汾ActivePython 2.5.2.2 (ActiveState Software Inc.) based on
Python 2.5.2 (r252:60911, Mar 27 2008, 17:57:18) [MSC v.1310 32 bit (Intel)] on win32)ÀïÃæµÄ°´Î»È¡·´¾¡È»²»ÊÇ°´Î»È¡·´£¬ÍøÉÏËѳöºÃ¶àÎÄÕ¶¼Ëµ¡«ÔÚpythonÖÐÊÇ°´Î»È¡·´£¬×Ô¼º²âÊÔÁËÏ£º
>>> ~3,~2,~1,~0,~-1,~-2,~3
(-4, -3, -2, -1, 0, 1, -4)
²Å»ÐÈ»´óÎò£¬Ô­À´ÊÇÕâÀï³ö´íÁË¡£
ÔÙ¿´£º
>>> import binascii
>>> binascii.crc32("ÎÒÃÇ")
-603163415
Èç¹û°ÑÏÂÃæ´úÂëµÄµ¹ÊýµÚ¶þÐÐ
dwCrc32 = dwCrc32 ^ 0xFFFFFFFFL
¸Ä³É
dwCrc32 = ~dwCrc32
È»ºóÔËÐУºmycrc32("ÎÒÃÇ") µÃµ½½á¹ûÒ²ÊÇ-603163415
ËùÒÔ»³ÒÉpython2.5ÀïÃæÊDz»ÊÇÒ²ÖÐÁËÕâ¸öÏÝÚåÁË¡£
ÓÃÏÂÃæµÄ´úÂëµÃµ½µÄ¾ÍºÍc´úÂë¼ÆËãµÃµ½µÄcrc32УÑéÂëÒ»ÖÂÁË¡£²»¹ýpythonÖ§³ÖµÄÕýÊýÒª±ÈcµÄ´ó£¬ËùÒÔ°´Î»Çó·´ÕâÀïÖ»Äܱ£Ö¤32λÇé¿öϵõ½ºÍc´úÂëÒ»ÑùµÄУÑéÂë¡£
#coding=gbk
def mycrc32(szString):
    m_pdwCrc32Table = [0 for x in range(0,256)]
    dwPolynomial = 0xEDB88320;
    dwCrc = 0
    for i in range(0,255):
        dwCrc = i
        for j in [8,7,6,5,4,3,2,1]:
            if dwCrc & 1:
                dwCrc = (dwCrc >> 1) ^ dwPolynomial
            else:
                dwCrc >>= 1
     &nb


Ïà¹ØÎĵµ£º

Python Import»úÖƱ¸Íü(ת)

Python Import»úÖƱ¸Íü(ת)
   ×î½üÔÚ¿´¡¶PythonÔ´ÂëÆÊÎö¡·£¬¶ÔPythonÄÚ²¿ÔËÐлúÖƱÈÒÔÇ°Á˽âµÄ¸üÉîÈëÁË£¬¸Ð¾õ×Ô¼ºÓлú»áÒ²¿ÉÒÔ×ö¸öСÐ͵Ķ¯Ì¬½Å±¾ÓïÑÔÁË£¬ºÇºÇ£¬µ±È»
ÊÇ´µÅ£ÁË¡£Ä¿µÄµ±È»²»ÊÇ´´ÔìÒ»¸ö¶¯Ì¬ÓïÑÔ£¬Ä¿µÄÖ»ÓÐÒ»¸ö£º¸üºÃµÄʹÓÃPython¡£¿´µ½Ä£¿éµ¼ÈëÄÇ¿éµÄʱºò£¬ÖÕÓÚ¶ÔÄ£¿éµ¼Èë»úÖƱȽÏÁ˽âÁË£¬ÒÔ·ÀÍ ......

pythonÖ®ÓéÀÖÀࣺħ·¨´«Öµ

»¹¼ÇµÃÊÇÒ»¸öÔµÄÊÂÇ飬ÉñÆæ°ãµÄÔÚyoutubeÉÏËÑË÷python£¬ÓиöÀÏÍâµÄ½Ì³ÌÀïÃæÓÐÕâô¸öÄÚÈÝ£º
#=============================
## python ħ·¨´«Öµ
#============================= 
#-*-coding:utf-8-*-
class sono:
    def Dict(self,**args):
        ret ......

PythonÓëMicrosoft Office×Ô¶¯»¯²Ù×÷

http://www.cnblogs.com/Jedimaster/archive/2007/02/28/660209.html
¡¡¡¡ÅóÓѵļÒÈË×öÉúÒ⣬ÿÈÕ´Ó¸÷µØ·Öµê´¦ÊÕ¼¯±¨±í£¬È»ºó»ØÈ¥»ã×Ü¡£ÓÉÓÚ²»ÏëÓÃÄÇÖÖ¸´ÔӵĹÜÀíÈí¼þ£¬¾Í½ÐËûдһ¸öС¹¤¾ß¡£ÓÚÊÇËûÕÒµ½ÁËÎÒ£¬ÈÃÎÒÏëÏë°ì·¨¡£
¡¡¡¡PythonÊǸöÁîÈ˾ªÆæµÄ¹¤¾ß£¬¶ø²»½ö½öÊÇÒ»ÖÖÓïÑÔ¡£¶Ô±ÈÀÏÅƵÄPerl£¬¿´ËÆPython²»ÊÇÄÇôµÄ¾«Í¨ ......

PythonÖеÄһЩÒì³£

ÆäʵÒì³£¾ÍÊDz»Õý³££¬¾ÍÊDz»ºÍÎÒÃÇÏëÏóÒ»ÑùÈ¥Ö´ÐС£ËüÊÇÒòΪ³ÌÐò³öÏÖÁË´íÎó¶øÔÚÕý³£¿ØÖÆÁ÷ÒÔÍâ²ÉÈ¡µÄÐÐΪ¡£Python³öÏÖÒì³££¬¾ÍÊÇÒòΪ¼ì²éÁËÒ»¸ö´íÎóʱ£¬Python½âÊÍÆ÷ÎÞ·¨¼ÌÐø¼ÌÐøÖ´ÐÐÏÂÈ¥£¬ÕâʱºòÅ׳öÁËÒì³£¡£ÍùÍùÕâ¸ö´íÎó·ÖΪÓï·¨ÉϺÍÂß¼­ÉÏ(²»Éó¤Ëµ¸ÅÄ-_-! )£¬¿´¿´¼¸¸öÀý×Ó£¬×ܽáһϣº
1¡¢NameError£º³¢ÊÔ·ÃÎÊÒ»¸öÎ ......

pythonдµÄ½«Ò»Ð©ÀàÐ͵ÄÎļþѹËõΪ7z¸ñʽ

#½«Ò»Ð©ÀàÐ͵ÄÎļþѹËõΪ7z.py
#for folder all file do 7z
import os
import sys
import distutils.file_util
def ImportOkFile():
    if(os.path.isfile("D:\\Records\\½«Ò»Ð©ÀàÐ͵ÄÎļþѹËõΪ7z_record.txt")==False):
        f=open("D:\\Reco ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ