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

½«PythonºÍAutoHotkey½áºÏÆðÀ´

http://www.autohotkey.com/forum/topic53773.html
Q:I am searching for is a way to execute AHK commands from a Python script. Is this possible?
A:Yes. Here is an example. 
tested with python2.6, requires AutoHotkey.dll in the working directory or path... 
ahkpython.py:
#Persistent
dllcall(A_ScriptParams, "int", 42, "cdecl int")
return
f1::
inputbox, x, enter a numerical parameter for python callback
result := dllcall(A_ScriptParams, "int", x, "cdecl int")
return 
ahkpython.ahk
from ctypes import *
ahk = cdll.AutoHotkey
pyclient = create_string_buffer("ahkpython.ahk") # no unicode in ahk
CMPFUNC = CFUNCTYPE(c_int, c_int)
def py_cmp_func(a):
print "ahk: " , a
return a
cmp_func = CMPFUNC(py_cmp_func)
fx = create_string_buffer(str(cast(cmp_func, c_void_p).value))
script = create_string_buffer("""
fx2(msg){
WinActivate %msg%
msgbox in function fx2 with %msg% from python
return "success"
}
""")
ahk.ahkdll(pyclient, "", fx)
ahk.ahkassign(create_string_buffer("fx"), fx)
ahk.addScript(script)
ahk.ahkFunction(create_string_buffer("fx2"), create_string_buffer("Untitled")) 
remarks: 
create_string_buffer is required because autohotkey.dll exported functions do not work with unicode. 
See HotkeyIt's excellent chm help file for documentation on the functions.


Ïà¹ØÎĵµ£º

ÓÃpython½øÐÐGUI¿ª·¢µÄÑ¡Ôñ

Python×î´óµÄÌØµã¾ÍÔÚÓÚËýµÄ¿ìËÙ¿ª·¢¹¦ÄÜ¡£×÷ΪһÖÖ½ºË®ÐÍÓïÑÔ£¬python¼¸ºõ¿ÉÒÔÉøÍ¸ÔÚÎÒÃDZà³Ì¹ý³ÌÖеĸ÷¸öÁìÓò¡£ÕâÀïÎÒ¼òµ¥½éÉÜÒ»ÏÂÓÃpython½øÐÐgui¿ª·¢µÄһЩѡÔñ¡£
 1.Tkinter
 TkinterËÆºõÊÇÓëtclÓïÑÔͬʱ·¢Õ¹ÆðÀ´µÄÒ»ÖÖ½çÃæ¿â¡£tkinterÊÇpythonµÄÅ䱸µÄ±ê×¼gui¿â£¬Ò²ÊÇopensourceµÄ²úÎï¡£Tkinter¿ÉÓÃÓÚwin ......

ÔÚWindowsÀï´î½¨PythonµÄGTK+»·¾³´î½¨×¢ÒâÊÂÏî

ÔÚWindowsÀï´î½¨PythonµÄGTK+»·¾³»¹ÊDZȽÏÂé·³µÄÓÐÒÔϼ¸¸ö×¢ÒâÊÂÏî
1¡¢PyGTKÍøÕ¾ÉÏϵİü£¬¿ÉÄÜûÓÐGladeÀࣨLib\site-packages\gtk-2.0\gtkĿ¼ÏÂûÓÐglade.pyd£©£¬Èç¹ûûÓÐÕâ¸öÀàÄã¾ÍÎÞ·¨ÔÚ³ÌÐòÀïµ¼ÈëGlade¹¤¾ß´´½¨µÄxml£¬ÊÖд½çÃæ»¹ÊÇͦÂé·³µÄ¡£
2¡¢GTKÍøÕ¾ÉϵÄGTK°ü£¬Ã»ÓаüÀ¨GladeµÄDLLÎļþ£¬»¹ÊÇÎÞ·¨¶ÁÈëGladeµÄxm ......

Pythonѧϰ±Ê¼Ç ¸ß¼¶Ö÷Ìâ

1.ÁбíµÄµÝ¹é---ÓÃÓÚÊä³öÁбí×Ö·û´®ÖеÄÿ¸öÔªËØ >>> def printList(L):
    #Èç¹ûΪ¿Õ£¬Ôòʲô¶¼²»×ö
    if not L:
        return
    #Èç¹ûÊÇÁ´±í£¬Ôò¶ÔµÚÒ»¸öÔªËØµ÷ÓÃprintListº¯Êý
 & ......

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

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

ʹÓÃPython´¦ÀíExcel±í¸ñ

http://cocobear.info/blog/2009/01/16/use-python-deal-with-excel/
ʹÓÃPython´¦ÀíExcel±í¸ñ 2009Äê01ÔÂ16ÈÕ
¸ø°³µÄbossдµÄÒ»¸öС¹¤¾ß£¬Ê¹ÓÃPython¶ÔExcel½øÐÐͳ¼Æ£¬È»ºó°Ñ½áÊøÉú³ÉÒ»¸öеÄExcel±í¸ñ£¬Ê¹Óõ½ÁËxlrdºÍpyExceleratorÁ½¸ö¿â¡£
¼òµ¥µÄ½éÉÜÒ»ÏÂÕâÁ½¸ö¿â£¬ÏÈ˵xlrd£¬Õâ¸ö¿â¶ÁExcel±È½Ï·½±ã£¬¸÷ÖÖ·½·¨Ê¹ÓÃÆ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ