摘要: import xml.etree.ElementTree as tree import io xml = ''' 2 2008 141100 5 2011 59900 69 ... 阅读全文
posted @ 2018-03-08 10:04 我是外婆 阅读(1732) 评论(0) 推荐(0) 编辑
摘要: def parent(): t = son() print(type(t)) result = t.send(None) # 开始迭代 print(result) result = t.send(20) print(result) result = t.send(None) #引发StopIteration def son(): n... 阅读全文
posted @ 2018-03-06 09:53 我是外婆 阅读(260) 评论(0) 推荐(0) 编辑
摘要: from collections import deque #deque 双端队列 线程安全 可以代替list 更高效 d = deque('abc') #初始化一个队列 for v in d: print(v.upper()) d.append(['1', '2', '3']) #追加 print(d) d.appendleft('1')#左追加 d.extend('123')#... 阅读全文
posted @ 2018-03-03 18:24 我是外婆 阅读(121) 评论(0) 推荐(0) 编辑
摘要: >>> class test(): def __init__(self): pass def __repr__(self): return '1sdf' >>> t = test() >>> t #不用print 直接打印出重构的值,面向程序,在程序中传递 1sdf >>> class test(Exception): def __i... 阅读全文
posted @ 2018-02-28 16:47 我是外婆 阅读(129) 评论(0) 推荐(0) 编辑
摘要: from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.Qt import * import sys, os, time, types class FileInfoTableWidget(QTableWidget): global_row_font =... 阅读全文
posted @ 2018-02-24 14:50 我是外婆 阅读(2060) 评论(0) 推荐(0) 编辑
摘要: # 效果图 阅读全文
posted @ 2018-02-07 18:29 我是外婆 阅读(543) 评论(0) 推荐(0) 编辑
摘要: from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * import sys class Example(QWidget): _startPos = None _endPos = None _isTracking = False def __init... 阅读全文
posted @ 2018-02-07 11:13 我是外婆 阅读(4273) 评论(1) 推荐(1) 编辑
摘要: from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from demo_6 import * import sys class ToolBar(QMainWindow): def __init__(self): super().__init__() ... 阅读全文
posted @ 2018-02-07 10:49 我是外婆 阅读(497) 评论(0) 推荐(0) 编辑
摘要: class PopMenu(QMenu): def __init__(self, parent=None): super().__init__(parent) self.item1 = self.addAction('item1') self.item1.setShortcut(Qt.CTRL | Qt.Key_Q) sel... 阅读全文
posted @ 2018-01-30 17:48 我是外婆 阅读(1458) 评论(0) 推荐(0) 编辑
摘要: from bs4 import BeautifulSoup from bs4.element import * data = """ beatifulsoup learning note i`m son1 哈哈 ... 阅读全文
posted @ 2018-01-29 11:25 我是外婆 阅读(276) 评论(0) 推荐(0) 编辑