摘要:
转自:http://www.cnblogs.com/rzhang/archive/2011/12/29/python-html-parsing.html Python里常用的网页解析库有BeautifulSoup和lxml.html,其中前者可能更知名一点吧,熊猫开始也是使用的BeautifulSoup,但是发现它实在有几个问题绕不过去,因此最后采用的还是lxml: 1. B... 阅读全文
摘要:
import sys def pstack(depth = 0): frame = sys._getframe(depth) cnt = 0 while frame: print "###", cnt, frame.f_code.co_name, frame.f_code.co_filename, frame.f_lineno fra... 阅读全文
摘要:
如果32位系统OFP的注册表路径是 HKEY_LOCAL_MACHINE\SOFTWARE\Bohemia Interactive\ 那么在64系统里就应该是 HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Bohemia Interactive\ 多了一级Wow6432Node 阅读全文
摘要:
import lxml.etree as et xml=""" apple pear strawberry blueberry starfruit mango peach """ tree=et.fromstring(xml) for bad in tree.xpath("//fruit[@state='rotten']"): ... 阅读全文
摘要:
def myYield2(): for i in range(3): yield '2222 i am in myYield2', 'i = ', i def myYield(): for i in range(10): yield '0000 i am in myYield', 'i = ', i for j in myY... 阅读全文
摘要:
转自: http://blog.csdn.net/lyq19870515/article/details/9450275 获取焦点事件: text.addListener(SWT.FocusIn, new Listener() { public void handleEvent(Event e) { // 处理得到焦点的事件 ... 阅读全文
摘要:
IsDisposed 获取指示操作窗口控件是否已被释放的值。 HelloSWT.java文件内容如下: package edu.ch4; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Text; import org.eclipse.sw... 阅读全文
摘要:
package cn.apr.chart; import java.net.*; import java.io.*; import java.util.*; public class ChatServer { /** * @param args * m_threads是一个Vector静态变量,维护所有Ser... 阅读全文