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

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

Python×î´óµÄÌصã¾ÍÔÚÓÚËýµÄ¿ìËÙ¿ª·¢¹¦ÄÜ¡£×÷ΪһÖÖ½ºË®ÐÍÓïÑÔ£¬python¼¸ºõ¿ÉÒÔÉø͸ÔÚÎÒÃDZà³Ì¹ý³ÌÖеĸ÷¸öÁìÓò¡£ÕâÀïÎÒ¼òµ¥½éÉÜÒ»ÏÂÓÃpython½øÐÐgui¿ª·¢µÄһЩѡÔñ¡£
 1.Tkinter
 TkinterËƺõÊÇÓëtclÓïÑÔͬʱ·¢Õ¹ÆðÀ´µÄÒ»ÖÖ½çÃæ¿â¡£tkinterÊÇpythonµÄÅ䱸µÄ±ê×¼gui¿â£¬Ò²ÊÇopensourceµÄ²úÎï¡£Tkinter¿ÉÓÃÓÚwindows/linux/unix/macintosh²Ù×÷ϵͳ£¬¶øÇÒÏÔʾ·ç¸ñÊDZ¾µØ»¯µÄ¡£TkinterÓÃÆðÀ´·Ç³£¼òµ¥£¬python×Ô´øµÄIDLE¾ÍÊDzÉÓÃËüдµÄ¡£³ý´ËÍ⣬tkinterµÄÀ©Õ¹¼¯pmwºÍTix¹¦ÄÜÉ϶¼ÒªÏà¶ÔËüÇ¿´ó£¬µ«tkinterÈ´ÊÇ×î»ù±¾µÄ¡£ÎÒÈÏΪ£¬ÔÚÓÃpython×ögui¿ª·¢£¬tkinterÊÇ×î»ù±¾µÄ֪ʶ£¬ËùÒÔÕâ¸ö»·½ÚÊDZØÐëҪѧϰµÄ¡£Äã»òÐíÔÚÒÔºóµÄ¿ª·¢Öв¢²»³£ÓÃtkinter£¬µ«ÊÇһЩСÐ͵ÄÓ¦ÓÃÉÏÃ棬Ëû»¹ÊǺÜÓÐÓõģ¬¶øÇÒ¿ª·¢ËÙ¶ÈÒ²ºÜ¿ì¡£
 2.WxPython
 WxWidgetsÓ¦¸ÃËãÊǽü¼¸ÄêÁ˱ȽÏÁ÷ÐеÄGUI¿çƽ̨¿ª·¢¼¼ÊõÁË¡£wxWidgetsÓв»Í¬µÄ°æ±¾Ó¦Óã¬ÓÐc++µÄ£¬Ò²ÓÐbasicµÄ£¬ÏÖÔÚÔÚpythonÉÏÃæÒ²ÓнϺõÄÒÆÖ²¡£wxpythonµÄ¹¦ÄÜÉÏÃæҪǿÓÚtkinter,ËýÌṩÁ˳¬¹ý200¸öÀ࣬ÃæÏò¶ÔÏóµÄ±à³Ì·ç¸ñ£¬Éè¼ÆµÄ¿ò¼ÜÀàËÆÓÚMFC¡£¶ÔÓÚ´óÐÍGUIÓ¦ÓÃÉÏÃ棬wxPython»¹ÊǾßÓкÜÇ¿µÄÓÅÊƵġ£boa constructor¿ÉÒÔ°ïÖúÎÒÃÇ¿ìËÙ¿ÉÊӵع¹½¨wxwidgets½çÃæ¡£
 3.PyQT
 QtͬÑùÊÇÒ»ÖÖ¿ªÔ´µÄGUI¿â£¬QtµÄÀà¿â´óÔ¼ÔÚ300¶à¸ö£¬º¯Êý´óÔ¼ÔÚ5700¶à¸ö¡£QtͬÑùÊʺÏÓÚ´óÐÍÓ¦Óã¬ÓÉËü×Ô´øµÄqt designer¿ÉÒÔÈÃÎÒÃÇÇáËÉÀ´¹¹½¨½çÃæÔªËØ¡£
 4.pyGtk
 GtkÊÇlinuxÏÂGnomeµÄºËÐÄ¿ª·¢¿âÁË¡£¹¦ÄÜÉÏÃæ·Ç³£ÆëÈ«¡£ÖµµÃ˵Ã÷µÄÊÇ£¬ÔÚwindowsƽ̨ÏÂgtkµÄÏÔʾ·ç¸ñ²¢²»ÊÇÌر𱾵ػ¯¡£²»¹ýËû´øµÄgladeµÄ½çÃæÉè¼ÆÆ÷»¹ÊÇ¿ÉÒÔ°ïÄãÊ¡²»ÉÙʵġ£
 5.Jython
 ³¢ÊÔ¹ýÓÃpython·ÃÎÊjavaÀà¿âÂð£¬ÄÇô¾ÍÓÃjython°É¡£jythonÆäʵ¿ÉÒÔÈÏΪÊÇÁíÍâÒ»¸öpython¿ª·¢»·¾³£¬»ùÓÚjavaµÄ£¬µ«ÊÇ´ó¶àÊýµÄCPythonµ÷ÓÃjythonÏ»¹ÊÇ¿ÉÒԵġ£Äã¿ÉÒÔÔÚjython»·¾³ÏÂÏñʹÓÃjavaÒ»ÑùÀ´Í¨¹ýpythonµÄÓï·¨À´µ÷ÓÃjavaÓïÑÔ£¬ÕæµÄºÜ¿á¡£
 6.MFC
 Windows Pywin32ÔÊÐíÄãÏñVCÒ»ÑùµÄÐÎʽÀ´Ê¹ÓÃPYTHON¿ª·¢win32Ó¦ÓᣴúÂë·ç¸ñ¿ÉÒÔÀàËÆwin32 sdk£¬Ò²¿ÉÒÔÀàËÆMFC£¬ÓÉÄãÑ¡Ôñ¡£Èç¹ûÄãÈÔ²»·ÅÆúvcÒ»ÑùµÄ´úÂë¹ý³ÌÔÚpythonÏ£¬ÄÇôÕâ¾ÍÊÇÒ»¸ö²»´íµÄÑ¡Ôñ¡£
 7.PythonCard
 PythonCardÆäʵÊǶÔwxPythonµÄÔÙ·â×°¡£²»¹ý·â×°µÄ¸ü¼Ó¼òµ¥£¬Ê¹ÓÃÆðÀ´¾õµÃ±ÈwxPython¸üÖ±¹Û£¬Ò²¸ü¼òµ¥»¯ÁË¡£
 8.Dabo
 ÈÔÊÇÒ»¸ö»ùÓÚwxpytho


Ïà¹ØÎĵµ£º

Ç¿´óµÄPythonÉú³ÉÆ÷

Öð²½Ñݽø
f=open('/etc/motd','r')
longest=0
while True:
    lineLen=len(f.readline().strip())
    if not lineLen: break
    if lineLen > longest:
        longest=lineLen
f.close()
return longest
ÎÊÌâ£ºÒ»Ö±Õ¼Ó ......

pythonѧϰ±Ê¼Ç£¨Ò»£©

Ê×ÏÈתÔØÒ»¶Î¹ØÓÚÍƼöµÄѧϰpythonµÄÊé¼®£¨Ô­ÎÄÁ´½Ó£©£º
1.ѧϰ¡¶A Byte of Python¡·£¬ÖÐÎÄÒëÃûΪ¡¶Python¼òÃ÷½Ì³Ì£¨pdfÏÂÔصØÖ·£©¡·£¬È«ÊéÏÂÀ´Ö»ÓÐ100¶àÒ³£¬¼òµ¥¸ÉÁ·£¬Í¨Ë×Ò׶®£¬Êǹ«ÈϵÄPythonÈëÃŽ̡̳£ÎÒËäȻϵ½ÁË¡¶Python¼òÃ÷½Ì³Ì¡·pdf°æ£¬µ«ÊǾõµÃÆäÖеĴúÂë¿ÉÄÜÊÇÒòΪÒëÕßת»»ÎĵµÀàÐ͵ÄÔ­Òò£¬¸ñʽ±äµÃºÜÂÒ£¬ËùÒÔ× ......

pythonË㷨ʵ¼ù1 Ö±½Ó²åÈëÅÅÐò

# Ö±½Ó²åÈëÅÅÐò
def InsertSort(mylist):
size = len(mylist)
i = 1
for i in range(1, size):
if mylist[i] < mylist[i - 1]:
tmp = mylist[i]
j = i - 1
mylist[j + 1] = mylist[j]

j = j - 1
while j > ......

pythonË㷨ʵ¼ù7 ¹é²¢ÅÅÐò

def MergeSort(mylist, low, mid, high):
i = low
j = mid + 1
tmp = []

while i <= mid and j <= high:
if mylist[i] <= mylist[j]:
tmp.append(mylist[i])
i = i + 1
else:
tmp.append(mylist[j])
j = j + 1 ......

Python ×ÖµäʹÓÃÀý×Ó


#!/usr/bin/env python
#coding=utf-8
def buildConnectionString(params):
    return ":".join(["%s=%s" %(k, v) for k, v in params.items()])
if __name__ == "__main__":
    myParams = {"server":"mpilgrim", \
               &nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ