ÔÚpythonÖÐʹÓÃdllµ¼³öº¯Êý
×î½üÔÚѧϰpy£¬Êµ¼ùÊÇ£ºÐ£ÑéÖ¸¶¨ÎļþÊÇ·ñ´òÉÏÊý×ÖÇ©Ãû~pythonµÄ±ê×¼¿âÖÐûÓÐÌṩÕâÀຯÊý£¬Í¬Ê±ÔÚÍøÉÏËÑÁËÒ»ÏÂҲûÓÐÕÒµ½µÚÈý·½µÄ°üÓÐÌṩ£¬×îºóÕÒµ½ÁË¿ÉÒÔʹÓÃCrypt32.dllµÄµ¼³öº¯ÊýCryptQueryObject()¡£
Ê×ÏÈÎÒÏ£Íûpywin32µÄ°üÖÐ×îºÃÒÑ·â×°ÕâÑùµÄapi£¬½á¹û·¢ÏÖûÓÐ-_-!¡£ÓÚÊDz»µÃ²»×Ô¼º¶¯ÊÖ~pyÖе÷ÓÃdllµÄµ¼³öº¯Êý·½·¨±È½Ï¼òµ¥£º
from ctypes import *
CryptQueryObject=windll.LoadLibrary("Crypt32.dll").CryptQueryObject
¿ÉÊǽÓÏÂÀ´ÎÊÌâÀ´ÁË¡£¡£CryptQueryObjectÖеIJÎÊýÔõô´¦Àí¡£¡£
BOOL WINAPI CryptQueryObject(
__in DWORD dwObjectType,
__in const void* pvObject,
__in DWORD dwExpectedContentTypeFlags,
__in DWORD dwExpectedFormatTypeFlags,
__in DWORD dwFlags,
__out DWORD* pdwMsgAndCertEncodingType,
__out DWORD* pdwContentType,
__out DWORD* pdwFormatType,
__out HCERTSTORE* phCertStore,
__out HCRYPTMSG* phMsg,
__out const void** ppvContext
);
²ÎÊýÀàÐÍÖÐÓÐÊý×Ö£¬Ö¸Õ룬ºê¶¨Òå¡£pyÖжÔÓÚ²ÎÊýûÓÐÕâô·á¸»µÄ¶¨Ò壬ͬʱҲûÓк궨Ò壬ÓÚÊÇÐèҪת»»³ÉpyÄÜÈÏʶµÄ£¬ÕâÓÖҪʹÓÃctypesÁË£¬googleµ½ÕâÕÅ±í£¬²¢½«ºê¶¨Òå»»³ÉÊýÖµ£º½á¹ûÈçÏÂ
bResult=CryptQueryObject(1,\
c_wchar_p(path),\
1024,\
2,\
0,\
None,\
None,\
None,\
None,\
&n
Ïà¹ØÎĵµ£º
pythonÖÐÀàµÄÊôÐÔ
pythonÖеÄÀà½Ðclass object,ÀàµÄʵÀý½Ðinstance object.
Àà Class Objects
ÀàÓµÓÐÁ½ÖÖ²Ù×÷,1.ÀàÊôÐÔ attribute references 2.ʵÀý»¯instantiation
1.ÀàÊôÐÔ¾ÍÏ൱ÓÚרÊôÓÚÒ»¸öÀàµÄ±äÁ¿(¼´Ä³Ð©ÓïÑÔÖеÄÀàµÄ¾²Ì¬¹«¹²±äÁ¿static public),ʹÓ÷½·¨ÊÇ:ÀàÃû³Æ.ÀàÊôÐÔÃû³Æ
2.ʵÀý»¯ÔòÊÇ´´½¨Ò»¸öÀàµÄʵÀýµÄ· ......
´Õ24ÊǾµäµÄÒæÖÇÓÎÏ·£¬¶àÍæ¿ÉÒÔʹÄÔ½îÁé»îÒ»µã£¬µ«Êǵ±Óöµ½ÎÞ½âµÄʱºò£¬¾Í»áºÜÉËÄԽΪ´Ë£¬Ð´¸ö³ÌÐòÀ´´úΪ¼ÆËã¡£
ÔËÐнá¹û£¬È¥³ýÁËÖØ¸´µÄһЩ±í´ïʽ£º
entry: 1
entry: 4
entry: 5
entry: 6
(4/(1-(5/6))) = 24
(6/((5/4)-1)) = 24
Press any key to exit...
entry: 3
entry: 3
entry: 8
entry: 8
(8/(3-(8 ......
½ñÌìѧϰÁËÒ»ÏÂPythonµÄ²Ù×÷·ûÖØÔØ£¬×ܽáÁ˼¸µã±È½ÏÉñÆæµÄ¶«¶«£º
------------------------------------------------------------------------------------------------------------
¹ØÓÚiter£º
Technically, iteration contexts work by calling the iter built-in function to try to
find an _ _iter_ _ method, whi ......
(1).µ±"print os.path.dirname(__file__)"ËùÔڽű¾ÊÇÒÔÍêÕû·¾¶±»ÔËÐеģ¬ ÄÇô½«Êä³ö¸Ã½Å±¾ËùÔÚµÄÍêÕû·¾¶£¬±ÈÈ磺
python d:\pythonSrc\test\test.py
&nb ......
MakoÊÇʲô£¿MokoÊÇPythonдµÄÒ»¸öÄ£°å¿â£¬Python¹ÙÍøpython.orgÓõľÍÊÇËüŶ¡£ÆäËû·Ï»°Ò²¾Í²»ÀÛ׸ÁË£¬Ö±½ÓÀ´µã´úÂ룬·½±ãÔĶÁÓëÁ˽â°Ñ¡£
(Mako¹ÙÍøµØÖ·£ºhttp://www.makotemplates.org/ £¬¿ÉÒÔÏÂÔØ°²×°°ü£¬ÍƼöʹÓÃeasy_install°²×°)
from mako.template import Template
mytemplate = Template("hello world!") ......