pythonÏ߳̽»Á÷ - °¤ÌßÖ°ÑÄ / ²ÅÈëÖ°³¡
תÌû£º
import sys
from wxPython.wx import *
from wxPython.lib import newevent
DispatchEvent, EVT_DISPATCH = newevent.NewEvent()
class GenericDispatchMixin:
def __init__(self):
EVT_DISPATCH(self, self.OnDispatchEvent)
def OnDispatchEvent(self, event):
event.method(*event.arguments)
def ThreadSafeDispatch(self, method, *arguments):
wxPostEvent(self, DispatchEvent(method = method, arguments = arguments))
import wx
import time
import threading
import Queue
import traceback
import sys
from GenericDispatch import GenericDispatchMixin
class MainApp(wx.App):
def OnInit(self):
self.frame = MainFrame()
self.frame.Show(True)
self.SetTopWindow(self.frame)
return True
class MainFrame(wx.Frame, GenericDispatchMixin):
def __init__(self):
wx.Frame.__init__(self, None, -1, u¡¯³¤ÔËÐвâÊÔ¡¯)
GenericDispatchMixin.__init__(self)
box = wx.BoxSizer(wx.HORIZONTAL)
self.ID_BTN = wx.NewId()
self.btn = wx.Button(self, self.ID_BTN, u¡¯¿ªÊ¼¡¯, size=(60, 22))
box.Add(self.btn, 0, wx.ALIGN_CENTRE|wx.ALL, 0)
Ïà¹ØÎÊ´ð£º
Python code:
p=[1,2,3,4,5,6]
while True:
for i in p:
if i==4:
p=[]
f=[9,8,7]
p.extend(f)
break
print i£¬',',
p. ......
#! c:\python26
# Filename: backup_ver1.py
import os
import time
source=[r'C:\test', r'C:\test1']
target_dir='D:\\back\\'
target=target_dir+time.strftime('%Y%m%d%H%M%S')+'.zip'
zip_command=" ......
C++Öе÷ÓÃpythonº¯Êý£¬·¢ÏÖpythonº¯ÊýµÄÒì³£ÔÚC++ÖÐÎÞ·¨²¶»ñ¡£
µ÷Óú¯ÊýÈçÏ£¬Çë´óÏÀ½â»ó
unsigned long CPythonHelper::Execute(const std::string& mml_cmd,
u ......
×î½üÒ»¸öÏîÄ¿ÂíÉϾÍÒªÓÃPython±àÁË ´ó¼ÒÍÆ¼ö¸öIDE¡£¡£¡£
1 Ãâ·Ñ¡£¡£¡£
2 Ìå»ý×îºÃСһµã
3 ¹¦ÄÜÇ¿´ó
£¨ÅÅÃû²»·ÖÏȺ󡣡£¡£·Ï»°¡£¡££©
emacs,×î´óµÄÓŵãÊÇÒòΪ·ÇͼÐνçÃæ£¬ÓÃSSHÔ¶³ÌµÇ¼Ҳ¿ÉÒÔʹÓá£ËùÒÔ¿ÉÒÔÓ ......
code:
remote = urllib.urlopen(remote_file)
local_file = open(local_path_name, "wb")
local_file.write(remote.read())
ÎÊÌâ:
ÓÃÕâÖÖ·½Ê½¿ÉÒԺܺõÄÏÂÔØÔ¶³ÌÎļþ, ÏÖÔÚÐèÒª¼ÓÈëÒ»¸ö½ø¶ÈÏÔʾµÄ¹¦Ä ......