tst.py

来自「下载来的一个看图软件的源代码」· Python 代码 · 共 29 行

PY
29
字号
#!/usr/bin/python -uimport sysimport libxml2# Memory debug specificlibxml2.debugMemory(1)doc = libxml2.parseFile("tst.xml")if doc.name != "tst.xml":    print "doc.name failed"    sys.exit(1)root = doc.childrenif root.name != "doc":    print "root.name failed"    sys.exit(1)child = root.childrenif child.name != "foo":    print "child.name failed"    sys.exit(1)doc.freeDoc()# Memory debug specificlibxml2.cleanupParser()if libxml2.debugMemory(1) == 0:    print "OK"else:    print "Memory leak %d bytes" % (libxml2.debugMemory(1))    libxml2.dumpMemory()

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?