摘要: IntroductionThe original bounty (whose content is farther down) required a scheduling widget for handling appointments in a medical doctor's office. This widget needed to support initially fixed time slots, dragging and dropping of appointments, etc.What Objects/Features are Involvedwx.gridwx.li 阅读全文
posted @ 2013-05-22 23:56 dengyigod 阅读(323) 评论(0) 推荐(0) 编辑
摘要: wx.CallAftertakes a function and its arguments, and calls the function when the current event handler has exited. It is a safe way of requesting action of a Window from another thread. The code below has a couple of examples.切换行号显示 1 import threading,wx 2 3 ID_RUN=101 4 ID_RUN2=102 5 6... 阅读全文
posted @ 2013-05-22 23:55 dengyigod 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 如果你经常使用python开发GUI程序的话,那么就知道,有时你需要很长时间来执行一个任务。当然,如果你使用命令行程序来做的话,你回非常惊讶。大部分情况下,这会堵塞GUI的事件循环,用户会看到程序卡死。如何才能避免这种情况呢?当然是利用线程或进程了!本文,我们将探索如何使用wxPython和theading模块来实现。wxpython线程安全方法wxPython中,有三个“线程安全”的函数。如果你在更新UI界面时,三个函数都不使用,那么你可能会遇到奇怪的问题。有时GUI也忙运行挺正常,有时却会无缘无故的崩溃。因此就需要这三个线程安全的函数:wx.PostEvent, wx.CallAfter和 阅读全文
posted @ 2013-05-22 23:45 dengyigod 阅读(960) 评论(0) 推荐(0) 编辑
摘要: 在GUI中进行多线程编程是一件很麻烦的事情,一直以来我都在寻找一个通用的方便的处理方法。在前一段时间中我曾经发表过关于长流程的处理,主要是在处理中插入一个对调度器的处理,而这个调度器使用了队列来实现子线程与主线程之间的数据通信。它的确可以解决一些问题,但并不是非常的方便。那么总结在wxPython中所提出的解决多线程问题的答案如下:不要在子线程中进行GUI的更新处理,所有的GUI的更新全部由GUI线程(主线程)来完成使用自定义事件来定义一个事件,然后就可以使用wxPostEvent来发送这个事件,这样会将这个事件放入主线程的事件循环中,从而使用事件得以安全的处理。使用线程安全的队列(Queue 阅读全文
posted @ 2013-05-22 23:44 dengyigod 阅读(537) 评论(0) 推荐(0) 编辑
摘要: >>> xlApp = win32com.client.Dispatch('Excel.Application')>>> xlBook = xlApp.Workbooks.Open("d:\\3.xls")a=xlBook.Worksheets("Sheet1")c = a.Cells.Find("dd")print c.Rowprint c.Column 阅读全文
posted @ 2013-05-17 01:14 dengyigod 阅读(174) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/ankier/archive/2012/10/10/2719003.htmlhttp://www.cnblogs.com/linuxcat/archive/2012/10/08/2715898.htmlhttp://blog.csdn.net/dyx1024/article/details/7866766http://www.cnblogs.com/dyx1024/archive/2012/07/07/2580656.htmlhttp://justcoding.iteye.com/blog/904219http://bluescorpio.cnbl 阅读全文
posted @ 2013-05-15 23:29 dengyigod 阅读(138) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/witcxc/archive/2011/12/28/2304870.htmlhttp://www.cnblogs.com/holbrook/archive/2012/02/15/2357335.htmlhttp://blog.csdn.net/seagle0128/article/details/4530871http://www.cnblogs.com/karotte/archive/2012/06/06/2537670.htmlhttp://www.cnblogs.com/jerry-chou/archive/2011/02/22/196001 阅读全文
posted @ 2013-04-24 00:30 dengyigod 阅读(99) 评论(0) 推荐(0) 编辑
摘要: xlApp = win32com.client.Dispatch('Excel.Application') #打开excel进程xlBook = xlApp.Workbooks.Open("d:\\1.xls") #读excel文件xlBook.Close(SaveChanges=1) #关闭xlBook句柄del xlApp #这个地方很重要,杀死excel进程是这个地方起作用 阅读全文
posted @ 2012-08-09 01:37 dengyigod 阅读(2866) 评论(0) 推荐(0) 编辑
摘要: 杀excel进程:app = win32com.client.Dispatch("Excel.Application")这个是激活Doc = app.Workbooks.Open(filepathname)Sheet = Doc.Sheets(sheetNo)这个是用表格的app.Quit() 这个是退出Sheet=NoneDoc=Noneapp=Nonewhile not app==None: pythoncom.PumpWaitingMessages()尤其是最后一个是必须的否则app没有退出完,你再打开另外一个sheet就会出错 阅读全文
posted @ 2012-08-09 00:57 dengyigod 阅读(1673) 评论(1) 推荐(0) 编辑
摘要: importUnRAR# extract all the files in test.rarUnRAR.Archive('test.rar').extract()# extract all the files in test.rar matching the wildcard *.txtUnRAR.Archive('test.rar').extract('*.txt')# print the name and size of each file, extracting small onesforfileInArchiveinUnRAR.Archi 阅读全文
posted @ 2012-08-03 02:19 dengyigod 阅读(188) 评论(0) 推荐(0) 编辑